diff options
Diffstat (limited to 'backend/src/main/java/org')
-rw-r--r-- | backend/src/main/java/org/luxons/sevenwonders/game/scoring/PlayerScore.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/backend/src/main/java/org/luxons/sevenwonders/game/scoring/PlayerScore.java b/backend/src/main/java/org/luxons/sevenwonders/game/scoring/PlayerScore.java index f67924e1..f4a0d832 100644 --- a/backend/src/main/java/org/luxons/sevenwonders/game/scoring/PlayerScore.java +++ b/backend/src/main/java/org/luxons/sevenwonders/game/scoring/PlayerScore.java @@ -1,21 +1,31 @@ package org.luxons.sevenwonders.game.scoring; import java.util.HashMap; +import java.util.Map; -public class PlayerScore extends HashMap<ScoreCategory, Integer> { +public class PlayerScore { private final int boardGold; + private final Map<ScoreCategory, Integer> scoresByCategory = new HashMap<>(); + private int totalPoints = 0; public PlayerScore(int boardGold) { this.boardGold = boardGold; } - @Override public Integer put(ScoreCategory category, Integer points) { totalPoints += points; - return super.put(category, points); + return scoresByCategory.put(category, points); + } + + public int getPoints(ScoreCategory category) { + return scoresByCategory.get(category); + } + + public Map<ScoreCategory, Integer> getPointsPerCategory() { + return scoresByCategory; } public int getTotalPoints() { |