Skip to content
Snippets Groups Projects
Commit c88438b9 authored by JimmyTheCat's avatar JimmyTheCat
Browse files

java doc GameUI handleTurn switch and Board turnEnd adjusted

parent f507b533
No related branches found
No related tags found
No related merge requests found
...@@ -67,9 +67,13 @@ public class Board extends Thread { ...@@ -67,9 +67,13 @@ public class Board extends Thread {
/** /**
* Ends the turn by increasing the mark counter and changing the player. * Ends the turn by increasing the mark counter and changing the player.
* Additionally it ends the game when certain conditions are met. * Defines an end state and returns it.
* end states:
* 0 = no draw, no winner
* 1 = current player won
* 2 = draw
* *
* @return current player won * @return end state of the turn.
*/ */
public int turnEnd() { public int turnEnd() {
marks++; marks++;
......
...@@ -168,7 +168,9 @@ public class GameUI extends Application{ ...@@ -168,7 +168,9 @@ public class GameUI extends Application{
winnerLabel.setText("It's a draw!"); winnerLabel.setText("It's a draw!");
stage.setScene(winningScene); stage.setScene(winningScene);
break; break;
default: default:
//should never be reached
System.out.println("How did we get here?"); System.out.println("How did we get here?");
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment