summaryrefslogtreecommitdiff
path: root/backend/src/main
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-04-16 19:28:46 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2017-04-16 19:28:46 +0200
commit20bd18a36647c646eabf4068fa892ecd01e01983 (patch)
treeaaa5d7b82516e392a2745245fed6d6baf49b77c6 /backend/src/main
parentAdd toString() methods for easier debugging (diff)
downloadseven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.tar.gz
seven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.tar.bz2
seven-wonders-20bd18a36647c646eabf4068fa892ecd01e01983.zip
Fix currentAge in PlayerTurnInfo
Diffstat (limited to 'backend/src/main')
-rw-r--r--backend/src/main/java/org/luxons/sevenwonders/game/api/PlayerTurnInfo.java12
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 + '}';
+ }
}
bgstack15