public static MazeCoordinatesDto getMazeCoordinates() { IntVector2[,] pacdotCoords = new IntVector2[100, 100]; //Any size large enough to fill the whole maze IntVector2 initialPosition = new IntVector2(2, 2); //bottom left MazeDirection currentDirection = MazeDirection.North; FFDiscoverMaze(initialPosition, currentDirection, pacdotCoords); List <IntVector2> retPDCoords = new List <IntVector2>(); for (int y = 0; y != 100; y++) { for (int x = 0; x != 100; x++) { if (pacdotCoords[x, y] != null) { retPDCoords.Add(pacdotCoords[x, y]); } } } MazeCoordinatesDto ret = new MazeCoordinatesDto(); ret.pacDotCoordinates = retPDCoords; return(ret); }
// Use this for initialization public void Initialize() { maze = Instantiate(mazePrefab) as Maze; coordinates = MazeUtil.getMazeCoordinates(); pacDotHandler.Initialize(coordinates.pacDotCoordinates, maze.transform); }