nsnake
Classic snake game for the terminal
GameStateMainMenu.hpp
1 #ifndef GAMESTATEMAINMENU_H_DEFINED
2 #define GAMESTATEMAINMENU_H_DEFINED
3 
4 #include <Flow/GameState.hpp>
5 #include <Interface/LayoutMainMenu.hpp>
6 #include <Interface/Menu/Menu.hpp>
7 #include <Interface/Menu/MenuAlphabetic.hpp>
8 #include <Interface/WindowGameHelp.hpp>
9 
13 {
14  friend class LayoutMainMenu;
15 
16 public:
18  virtual ~GameStateMainMenu() { };
19 
20  void load(int stack=0);
21 
26  int unload();
27 
29 
30  void draw();
31 
32 private:
33  LayoutMainMenu* layout;
34 
36  Menu* menu;
37 
38  MenuAlphabetic* menuLevels;
39  bool menuLevelsActivated;
40 
41  Menu* menuGameSettings;
42  bool menuGameSettingsActivated;
43 
44  Menu* menuGUIOptions;
45  bool menuGUIOptionsActivated;
46 
47  Menu* menuControls;
48  bool menuControlsActivated;
49 
50  WindowGameHelp* helpWindows;
51 
52  // easily create internal menus
53  void createMainMenu();
54  void createGameSettingsMenu();
55  void createLevelsMenu();
56  void createGUIOptionsMenu();
57  void createControlsMenu();
58  void saveSettingsMenuGUIOptions();
59  void saveSettingsMenuGameSettings();
60 };
61 
62 #endif //GAMESTATEMAINMENU_H_DEFINED
63 
void load(int stack=0)
Where every state initializes it&#39;s resources.
Specific Window that shows Help and other info during Game.
int unload()
Gets called when we&#39;re leaving this menu.
GameState::StateCode update()
Called every frame, where states calculate everything that can change.
void draw()
Called every frame, where states draw stuff on screen.
List of selectable items.
Definition: Menu.hpp:28
How we show the screen at GameStateMainMenu.
Abstract definition of a game state.
Definition: GameState.hpp:31
StateCode
All possible transitions between states.
Definition: GameState.hpp:39
Menu on which its items are always sorted alphabetically.