void InitializeMaze() { maze = new Maze(mapWidth / 3, mapHeight / 3); if (algorithm == Algo.DEEP_FIRST) { maze.GenerateRandomMazeDeepFirst(weightLeft, weightRight, weightTop, weightBottom); } else if (algorithm == Algo.BREATHE_FIRST) { maze.GenerateRandomMazeBreatheFirst(weightLeft, weightRight, weightTop, weightBottom); } maze.ApplyToMap(srcGrid, 1); pathStart = new Vec3di(maze.begin.Position.x * 3, maze.begin.Position.y * 3, 0); pathEnd = new Vec3di(maze.end.Position.x * 3, maze.end.Position.y * 3, 0); agent.ownPosition = pathStart; }