Exemplo n.º 1
0
 public MainController()
 {
     game   = new Game();
     reader = new MazeReader(game);
     reader.CreateLinks(reader.ReadMaze(4));
     mazeView  = new MazeView(game);
     inputView = new InputView();
     run();
     Console.ReadLine();
 }
Exemplo n.º 2
0
 public void run()
 {
     mazeView.showStartingScreen();
     reader.CreateLinks(reader.ReadMaze(inputView.getMazeNumber()));
     while (true)
     {
         mazeView.showBoard();
         int input = inputView.readInput(inputView.validInputGiven());
         if (input >= 0)
         {
             game.moveTruck(input);
         }
         else if (input == -1)
         {
         }
         else
         {
             mazeView.showStartingScreen();
             reader.CreateLinks(reader.ReadMaze(inputView.getMazeNumber()));
         }
     }
 }