private void InitSquares() { mSquares = new PathfinderSquare[maxX + 1, maxY + 1]; for (int x = 0; x <= maxX; x++) { for (int y = 0; y <= maxY; y++) { mSquares[x, y] = new PathfinderSquare(); mSquares[x, y].TileType = map.Tile[x, y].Type; mSquares[x, y].DistanceSteps = 10000; mSquares[x, y].IsPath = false; } } }