12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package pathgame.gameplay;
- /**
- * A container for the gamestate
- *
- * @author julia
- */
- public class Gamestate
- {
- private Gamestates state = Gamestates.MENU;
- /**
- * Sets the current gamestate
- *
- * @param state the desired gamestate
- */
- public void setState(Gamestates state)
- {
- this.state = state;
- }
- /**
- * Returns the current gamestate
- *
- * @return the current game state
- */
- public Gamestates getState()
- {
- return state;
- }
- /**
- * Returns if current gamestate is same as gamestate from parameter
- *
- * @param gamestate the gamestate that has to be checked if it is the
- * current
- * @return if current gamestate is same as gamestate from parameter
- */
- public boolean is(Gamestates gamestate)
- {
- return state == gamestate;
- }
- }
|