コード例 #1
0
ファイル: BomberAgent.cs プロジェクト: vermagav/bombersquad
            public BomberAgent(GameState gs, bool isBombPassable, int agentID)
            {
                this.gs = gs;
                this.isBombPassable = isBombPassable;
                this.agentId = agentID;
                this.chokepoints = new ChokePoints(this.gs, this.isBombPassable);
                this.suicideBomberFSM = new FSM<BomberAgent>(this, null, null);
                State<BomberAgent> state = new PursueState(this.gs, this.isBombPassable);
                this.suicideBomberFSM.changeState(state);

                this.safeBomberFSM = new FSM<BomberAgent>(this, null, null);
                state = new PursueState(this.gs, this.isBombPassable);
                this.safeBomberFSM.changeState(state);

                this.blockEscapeFSM = new FSM<BomberAgent>(this, null, null);
                state = new PursueState(this.gs, this.isBombPassable);
                this.blockEscapeFSM.changeState(state);

                this.surroundFSM = new FSM<BomberAgent>(this, null, null);
                //state = new PredictDestinationState(this.gs, this.isBombPassable);
                state = new SurroundState(this.gs, this.isBombPassable);
                this.surroundFSM.changeState(state);
            }
コード例 #2
0
ファイル: Map.cs プロジェクト: jaoel/LD44
    public void DrawDebug()
    {
        if (_drawBounds && Bounds != null)
        {
            GizmoUtility.DrawRectangle(Bounds.ToRectInt(), Color.cyan);
        }

        if (_drawCells && Cells != null)
        {
            Cells.ForEach(x =>
            {
                switch (x.Type)
                {
                case MapNodeType.Default:
                    {
                        GizmoUtility.DrawRectangle(x.Cell, Color.black);
                    }
                    break;

                case MapNodeType.Room:
                    {
                        if (x.Lockable)
                        {
                            GizmoUtility.DrawRectangle(x.Cell, Color.green);
                        }
                        else
                        {
                            GizmoUtility.DrawRectangle(x.Cell, Color.red);
                        }
                    }
                    break;

                case MapNodeType.Corridor:
                    {
                        GizmoUtility.DrawRectangle(x.Cell, Color.blue);
                    }
                    break;

                default:
                    break;
                }
            });

            ChokePoints.ForEach(x =>
            {
                GizmoUtility.DrawRectangle(x.ToRectInt(), Color.magenta);
            });
        }

        if (_drawDelaunay && DelaunayGraph != null)
        {
            DelaunayGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.cyan);
            });
        }

        if (_drawGabriel && GabrielGraph != null)
        {
            GabrielGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.magenta);
            });
        }

        if (_drawEMST && EMSTGraph != null)
        {
            EMSTGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.cyan);
            });
        }

        if (_drawLayout && LayoutGraph != null)
        {
            LayoutGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.magenta);
            });

            if (StartToGoalPath != null)
            {
                StartToGoalPath.ForEach(x =>
                {
                    GizmoUtility.DrawLine(x, new Color(159 / 255.0f, 90 / 255.0f, 253 / 255.0f, 1));
                });
            }
        }

        if (_drawCorridors && CorridorGraph != null)
        {
            CorridorGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.red);
            });
        }
    }