Ejemplo n.º 1
0
        private List <FireNode> findNearFirePoints(FireNode point)
        {
            int             height     = FloorPlanManager.getInstance().getHeight();
            int             width      = FloorPlanManager.getInstance().getWidth();
            List <FireNode> pointNodes = new List <FireNode>();

            //up
            if (!nodes[point.x, Math.Max(point.y - 1, 0)].isGoingToFire())
            {
                pointNodes.Add(new FireNode(point.x, Math.Max(point.y - 1, 0)));
            }
            //down
            if (!nodes[point.x, Math.Min(point.y + 1, height - 1)].isGoingToFire())
            {
                pointNodes.Add(new FireNode(point.x, Math.Min(point.y + 1, height - 1)));
            }
            //left
            if (!nodes[Math.Max(point.x - 1, 0), point.y].isGoingToFire())
            {
                pointNodes.Add(new FireNode(Math.Max(point.x - 1, 0), point.y));
            }
            //right
            if (!nodes[Math.Min(point.x + 1, width - 1), point.y].isGoingToFire())
            {
                pointNodes.Add(new FireNode(Math.Min(point.x + 1, width - 1), point.y));
            }

            return(pointNodes);
        }
Ejemplo n.º 2
0
 public void setNodeFired(FireNode point)
 {
     nodes[point.x, point.y].setFired();
 }
Ejemplo n.º 3
0
 public bool isNodeFired(FireNode point)
 {
     return(nodes[point.x, point.y].isFired());
 }
Ejemplo n.º 4
0
 public void addPoint(FireNode point)
 {
     firingPoints.Add(point);
 }