public Engine() { labyrinth = new LabyrinthBoard(); topScores = new TopScores(); flagContinue = true; enterMove = "\nEnter your move (L=left, R=right, U=up, D=down):"; welcome = "Welcome to “Labirinth” game. Your goal is to escape. \nUse 'top' to view the top scoreboard, \n'restart' to start a new game \nand 'exit' to quit the game.\n"; }
public Engine(LabyrinthBoard labyrinthBoard, TopScores scores, UserInput userInterface) { this.Labyrinth = labyrinthBoard; this.TopScores = scores; this.UserInterface = userInterface; }
public void TestConstructorForExceptions() { testBoard = new LabyrinthBoard(); // Checking for exceptions. }
public void Restart() { this.flagContinue = true; this.labyrinth = new LabyrinthBoard(); this.labyrinth.InitializeLabyrinth(); Console.WriteLine("\n" + this.welcome); Console.Write(this.labyrinth.ToString()); this.Move(); }
private char[,] GetCharArray(LabyrinthBoard board) { string boardToString = board.ToString(); string[] rows = boardToString.Split(new string[] {Environment.NewLine}, StringSplitOptions.None); char[,] charRepresentation = new char[LabyrinthBoard.LABYRINTH_SIZE,LabyrinthBoard.LABYRINTH_SIZE]; for(int i = 0; i < LabyrinthBoard.LABYRINTH_SIZE; i++) { string[] splitRow = rows[i].Split(' '); for(int u = 0; u < LabyrinthBoard.LABYRINTH_SIZE; u++) { charRepresentation[i,u] = splitRow[u][0]; // If all is fine, there should be only one member in this string. } } return charRepresentation; }