51 lines
1.3 KiB
Java
51 lines
1.3 KiB
Java
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.Iterator;
|
|
|
|
/** Represents a game state view containing getters for all the properties of a {@link GameState}. */
|
|
public class GameStateView {
|
|
/** The managed {@link GameState} */
|
|
private final GameState state;
|
|
|
|
/**
|
|
* Constructs a new {@link GameStateView}.
|
|
* @param state A reference to the state to be viewable
|
|
*/
|
|
public GameStateView(GameState state) {
|
|
this.state = state;
|
|
}
|
|
|
|
public IntVector2 getMapSize() {
|
|
return state.mapSize;
|
|
}
|
|
|
|
public Iterator<Entity> 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 int getStoneCooldown(StoneType stone) {
|
|
return state.stoneCooldown.getCooldown(stone);
|
|
}
|
|
}
|