示例#1
0
文件: Map.cs 项目: Peterlamb/OpenNos
 public bool IsBlockedZone(int x, int y)
 {
     if (!_grid.IsWalkableAt(new GridPos(x, y)))
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 public StaticGrid(StaticGrid b)
     : base(b) {
     bool[][] tMatrix = new bool[b.width][];
     for (int widthTrav = 0; widthTrav < b.width; widthTrav++) {
         tMatrix[widthTrav] = new bool[b.height];
         for (int heightTrav = 0; heightTrav < b.height; heightTrav++) {
             if (b.IsWalkableAt(widthTrav, heightTrav))
                 tMatrix[widthTrav][heightTrav] = true;
             else
                 tMatrix[widthTrav][heightTrav] = false;
         }
     }
     this.m_nodes = buildNodes(b.width, b.height, tMatrix);
 }
示例#3
0
        public StaticGrid(StaticGrid b)
            : base(b)
        {
            var matrix = new bool[b.Width][];

            for (var x = 0; x < b.Width; x++)
            {
                matrix[x] = new bool[b.Height];
                for (var y = 0; y < b.Height; y++)
                {
                    matrix[x][y] = b.IsWalkableAt(x, y);
                }
            }

            Nodes = BuildNodes(b.Width, b.Height, matrix);
        }
示例#4
0
 public ObstacleValue GetObstacleValue(float fx, float fy)
 {
     return(mSearchGrid.IsWalkableAt((int)(fx * 2), (int)(fy * 2))
         ? ObstacleValue.Walkable
         : ObstacleValue.Unwalkable);
 }