public void BuildMaze(int size) { if (size < 2) { throw new InvalidMazeSizeException($"Maze dimension must be 2 or greater."); } Maze = MazeHandler.NewMaze(MazeType.VerySimpleMaze, size); }
public int?GetRoom(int roomId, char direction) { if (!Util.IndexInMazeRange(Maze, roomId)) { throw new IndexOutOfRangeException($"Invalid roomId {roomId} for maze of size {Maze.Size}."); } return(MazeHandler.TraverseMaze(Maze, roomId, direction)); }
public bool CausesInjury(int roomId) { if (!Util.IndexInMazeRange(Maze, roomId)) { throw new IndexOutOfRangeException($"Invalid roomId {roomId} for maze of size {Maze.Size}."); } return(MazeHandler.TrapCheck(new RandomGenerator(), Maze, roomId)); }