2021-04-29 17:15:29 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
|
|
|
|
|
|
|
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2021-04-30 18:54:34 +00:00
|
|
|
import java.util.Iterator;
|
2021-04-29 17:15:29 +00:00
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** Represents a game state view containing getters for all the properties of a {@link GameState}. */
|
2021-04-29 17:15:29 +00:00
|
|
|
public class GameStateView {
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The managed {@link GameState} */
|
2021-04-29 17:15:29 +00:00
|
|
|
private final GameState state;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/**
|
|
|
|
* Constructs a new {@link GameStateView}.
|
|
|
|
* @param state A reference to the state to be viewable
|
2021-04-29 17:15:29 +00:00
|
|
|
*/
|
|
|
|
public GameStateView(GameState state) {
|
|
|
|
this.state = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
//TODO: add immutable getters for all state properties
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
public Iterator<Entity> getEntities() {
|
|
|
|
return state.entities.getEntities();
|
2021-04-29 17:15:29 +00:00
|
|
|
}
|
|
|
|
}
|