From fcd2338b1136657aa949e5ee13e54e4c3d708f26 Mon Sep 17 00:00:00 2001 From: punchready Date: Fri, 30 Apr 2021 21:48:48 +0200 Subject: [PATCH] feat: implement all getters in GameStateView --- .../gamelibrary/gamelogic/GameStateView.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateView.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateView.java index 1b34930..6c2d26a 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateView.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateView.java @@ -1,6 +1,9 @@ package uulm.teamname.marvelous.gamelibrary.gamelogic; +import uulm.teamname.marvelous.gamelibrary.IntVector2; import uulm.teamname.marvelous.gamelibrary.entities.Entity; +import uulm.teamname.marvelous.gamelibrary.entities.EntityID; +import uulm.teamname.marvelous.gamelibrary.entities.StoneType; import java.util.ArrayList; import java.util.Iterator; @@ -18,9 +21,31 @@ public class GameStateView { this.state = state; } - //TODO: add immutable getters for all state properties + public IntVector2 getMapSize() { + return state.mapSize; + } public Iterator getEntities() { return state.entities.getEntities(); } + + public int getRoundNumber() { + return state.roundNumber; + } + + public int getTurnNumber() { + return state.turnNumber; + } + + public EntityID getActiveCharacter() { + return state.activeCharacter; + } + + public boolean isWon() { + return state.won; + } + + public float getStoneCooldown(StoneType stone) { + return state.stoneCooldown.get(stone); + } }