diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-04-16 19:28:46 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-04-16 19:28:46 +0200 |
commit | 20bd18a36647c646eabf4068fa892ecd01e01983 (patch) | |
tree | aaa5d7b82516e392a2745245fed6d6baf49b77c6 | |
parent | Add toString() methods for easier debugging (diff) | |
download | seven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.tar.gz seven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.tar.bz2 seven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.zip |
Fix currentAge in PlayerTurnInfo
-rw-r--r-- | backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java b/backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java index c4cea17f..ccb045c2 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java +++ b/backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java @@ -8,7 +8,7 @@ public class PlayerTurnInfo { private final Table table; - private int currentAge; + private final int currentAge; private Action action; @@ -19,6 +19,7 @@ public class PlayerTurnInfo { public PlayerTurnInfo(int playerIndex, Table table) { this.playerIndex = playerIndex; this.table = table; + this.currentAge = table.getCurrentAge(); } public int getPlayerIndex() { @@ -33,10 +34,6 @@ public class PlayerTurnInfo { return currentAge; } - public void setCurrentAge(int currentAge) { - this.currentAge = currentAge; - } - public List<HandCard> getHand() { return hand; } @@ -60,4 +57,9 @@ public class PlayerTurnInfo { public void setMessage(String message) { this.message = message; } + + @Override + public String toString() { + return "PlayerTurnInfo{" + "playerIndex=" + playerIndex + ", action=" + action + ", hand=" + hand + '}'; + } } |