diff --git a/app/src/main/java/org/toop/app/game/Connect4Game.java b/app/src/main/java/org/toop/app/game/Connect4Game.java index 50af89f..bd063b0 100644 --- a/app/src/main/java/org/toop/app/game/Connect4Game.java +++ b/app/src/main/java/org/toop/app/game/Connect4Game.java @@ -87,6 +87,7 @@ public class Connect4Game { if (onForfeit == null || onExit == null) { new Thread(this::localGameThread).start(); + setGameLabels(information.players[0].isHuman); } else { new EventFlow() .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) @@ -104,7 +105,13 @@ public class Connect4Game { private void localGameThread() { while (isRunning.get()) { final int currentTurn = game.getCurrentTurn(); - setGameLabels(information.players[currentTurn].isHuman); + final String currentValue = currentTurn == 0? "RED" : "BLUE"; + final int nextTurn = (currentTurn + 1) % GameInformation.Type.playerCount(information.type); + + view.nextPlayer(information.players[currentTurn].isHuman, + information.players[currentTurn].name, + currentValue, + information.players[nextTurn].name); Game.Move move = null; diff --git a/app/src/main/java/org/toop/app/game/ReversiGame.java b/app/src/main/java/org/toop/app/game/ReversiGame.java index e90c98d..fa5c611 100644 --- a/app/src/main/java/org/toop/app/game/ReversiGame.java +++ b/app/src/main/java/org/toop/app/game/ReversiGame.java @@ -91,6 +91,7 @@ public final class ReversiGame { if (onForfeit == null || onExit == null) { new Thread(this::localGameThread).start(); + setGameLabels(information.players[0].isHuman); } else { new EventFlow() .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) @@ -118,7 +119,13 @@ public final class ReversiGame { } final int currentTurn = game.getCurrentTurn(); - setGameLabels(information.players[currentTurn].isHuman); + final String currentValue = currentTurn == 0? "BLACK" : "WHITE"; + final int nextTurn = (currentTurn + 1) % GameInformation.Type.playerCount(information.type); + + view.nextPlayer(information.players[currentTurn].isHuman, + information.players[currentTurn].name, + currentValue, + information.players[nextTurn].name); Game.Move move = null; diff --git a/app/src/main/java/org/toop/app/game/TicTacToeGame.java b/app/src/main/java/org/toop/app/game/TicTacToeGame.java index 7e5db6b..9725aa9 100644 --- a/app/src/main/java/org/toop/app/game/TicTacToeGame.java +++ b/app/src/main/java/org/toop/app/game/TicTacToeGame.java @@ -103,7 +103,13 @@ public final class TicTacToeGame { private void localGameThread() { while (isRunning.get()) { final int currentTurn = game.getCurrentTurn(); - setGameLabels(information.players[currentTurn].isHuman); + final String currentValue = currentTurn == 0? "X" : "O"; + final int nextTurn = (currentTurn + 1) % GameInformation.Type.playerCount(information.type); + + view.nextPlayer(information.players[currentTurn].isHuman, + information.players[currentTurn].name, + currentValue, + information.players[nextTurn].name); Game.Move move = null;