nsnake
Classic snake game for the terminal
LayoutGame.hpp
1 #ifndef LAYOUTGAMEMODESURVIVAL_H_DEFINED
2 #define LAYOUTGAMEMODESURVIVAL_H_DEFINED
3 
4 #include <Interface/Layout.hpp>
5 #include <Interface/Menu/Menu.hpp>
6 #include <Interface/WindowGameHelp.hpp>
7 #include <Game/Game.hpp>
8 
9 #include <vector>
10 
11 class LayoutGame: public Layout
12 {
13 public:
14  // Telling the compiler (clang) that we're
15  // hiding the parent's virtual function
16  using Layout::draw;
17 
18  LayoutGame(Game* game, int width, int height);
19  virtual ~LayoutGame();
20 
21  void windowsInit();
22  void windowsExit();
23 
24  void draw(Menu* menu);
25 
26 private:
27  Game* game;
28 
29  // On `Layout` we have a `main` Window, where
30  // everything's inside
31 
33  Window* gamewin;
34 
36  Window* info;
37 
38 // HACK so we can get width and height to create menu
39 // on the Game
40 public:
43 
46 
47 private:
48  Window* boardwin;
49 
50  WindowGameHelp* helpWindows;
51 };
52 
53 #endif //LAYOUTGAMEMODESURVIVAL_H_DEFINED
54 
A segment of the terminal screen (2D char matrix).
Definition: Window.hpp:16
Specific Window that shows Help and other info during Game.
Definition: Game.hpp:16
Window * help
Contains the help screen.
Definition: LayoutGame.hpp:45
Window * pause
Contains the pause menu.
Definition: LayoutGame.hpp:42
List of selectable items.
Definition: Menu.hpp:28
Interface for how the things are shown on the screen.
Definition: Layout.hpp:15