12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package pathgame.gameplay.menu;
- import me.hammerle.snuviengine.api.Engine;
- import pathgame.gameplay.Gamestates;
- /**
- * A container for holding all options of the EscapeMenu
- *
- * @author julia
- */
- public class EscMenu extends BaseMenu
- {
- private final MenuButton[] options;
- /**
- * Contructor generating and initializing the EscapeMenu
- *
- * @param id the id of the EscapeMenu
- * @param mainId the id to the MainMenu
- */
- public EscMenu(int id, int mainId)
- {
- super(id);
- options = new MenuButton[]
- {
- new MenuButton("Continue", (gamestate) ->
- {
- gamestate.setState(Gamestates.GAMEPLAY);
- }),
- new MenuButton("Main Menu", (gamestate) ->
- {
- setReturnId(mainId);
- }),
- new MenuButton("Exit", (gamestate) ->
- {
- Engine.stop();
- }),
- };
- }
- /**
- * Returns the options of the EscapeMenu
- *
- * @return the options of the EscapeMenu
- */
- @Override
- public MenuButton[] getOptions()
- {
- return options;
- }
- }
|