root/src/AIRendering/DrawableActor.cs

123
29
        {
29
        {
30
            if (behavior == null)
30
            if (behavior == null)
31
                return;
31
                return;
32
            foreach (var item in behavior.SubBehaviors)
32
            if (behavior is ISubBehaviorHolder)
33
            {
33
            {
34
                
35
                ISubBehaviorHolder subs = (ISubBehaviorHolder)behavior;
36
                foreach (var item in subs.SubBehaviors)
37
                {
34
38
35
                if (item.State == BehaviorState.Running && item is IRender)
39
                    if (item.State == BehaviorState.Running && item is IRender)
36
                    ((IRender)item).Render(batch);
40
                        ((IRender)item).Render(batch);
37
                DrawBehavior(item, batch);
41
                    DrawBehavior(item, batch);
42
                }
38
            }
43
            }
44
            if (behavior is IRender)
45
                ((IRender)behavior).Render(batch);
46
            if (CellsIAmIn.Count > 0)
47
            {
48
                Vector2 cellsize = new Vector2(ParentWorld.Map.ClusterGrid.Grids[0].CellSize);
49
                batch.DrawBox(CellsIAmIn[0].Position - (cellsize / 2),
50
                    CellsIAmIn[0].Position + (cellsize / 2), Color.Blue);
51
            }
52
            
39
        }
53
        }
40
54
41
    }
55
    }