示例#1
0
 public Map(int mapWidth, int mapHeight)
 {
     width = mapWidth;
     height = mapHeight;
     cellArray = new Cell[width, height];
     for (int y = 0; y < width; y++)
     {
         for (int x = 0; x < height; x++)
         {
             cellArray[x, y] = new Cell(Cell.CellStates.FREE, x, y);
         }
     }
 }
示例#2
0
 //---- Manhattan distance calculators - helper function.
 public static int manhattanCellToPos(Cell c, Tuple<int, int> pos)
 {
     return Math.Abs(c.x - pos.Item1) + Math.Abs(c.y - pos.Item2);
 }