123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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("Retry", (gamestate, level) ->
- {
- level.reset();
- 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;
- }
- }
|