diff --git a/src/main/java/org/toop/game/tictactoe/TicTacToe.java b/src/main/java/org/toop/game/tictactoe/TicTacToe.java index 6ef249e..f43d617 100644 --- a/src/main/java/org/toop/game/tictactoe/TicTacToe.java +++ b/src/main/java/org/toop/game/tictactoe/TicTacToe.java @@ -96,18 +96,34 @@ public class TicTacToe extends GameBase implements Runnable { // Attempt to play the move State state = play(index); + if (state != State.INVALID){ + // Tell all players who made a move and what move was made + // TODO: What is the reaction of the game? WIN, DRAW etc? + String player = getCurrentPlayer().name(); + addSendToQueue("SVR GAME MOVE {PLAYER: \"" + + getCurrentPlayer().name() + + "\", DETAILS: \"\",MOVE: \"" + + index + + "\"}\n"); + } + // Check move result switch (state){ case State.WIN:{ // Win running = false; + addSendToQueue("VR GAME WIN {PLAYERONESCORE: \"\", PLAYERTWOSCORE: \"" + + "\", COMMENT: \"\"}\n"); } case State.DRAW:{ // Draw running = false; + addSendToQueue("VR GAME DRAW {PLAYERONESCORE: \"\", PLAYERTWOSCORE: \"" + + "\", COMMENT: \"\"}\n"); } case State.NORMAL:{ - // Nothing wrong? + // Valid move but not end of game + addSendToQueue("SVR GAME YOURTURN"); } case State.INVALID:{ // Invalid move