Gamelib/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameStateView.java

27 lines
718 B
Java

package uulm.teamname.marvelous.gamelibrary.gamelogic;
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
import java.util.ArrayList;
/** 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;
}
//TODO: add immutable getters for all state properties
public ArrayList<Entity> getEntities() {
return new ArrayList<>(state.entities);
}
}