1. Alex Hixon
  2. quoridor

Commits

Alex Hixon  committed 3eff79b

Quit nicely.

  • Participants
  • Parent commits 77e621b
  • Branches default

Comments (0)

Files changed (1)

File src/view/ConsoleUI.java

View file
         // keep playing until we have a winner
         // playGame stops if someone returned a bad move (eg a human player returnning null)
         while (game.playGame() == null) {
-            if (game.getCurrentPlayer().getType () != "console"){
+            if (game.getCurrentPlayer().getType ().equals("console")){
                 System.out.println("AI returned a null move - that's badness!");
                 System.out.println("Quitting");
                 return;
                 // this logic probably belongs in Game?
             } else {
-                System.out.println("WANT TO SAVE AND STUFF?");
+                //System.out.println("WANT TO SAVE AND STUFF?");
                 break;
             }
         }
 
-        System.out.println("Congratulations! " + game.getWinner().getName() + " has won the game!");
+        if (game.hasWinner()) {
+            System.out.println("Congratulations! " + game.getWinner().getName() + " has won the game!");
+        }
 
     }