Debian Codegraph @

src/menumanager.h

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 // menumanager.h
2 //
3 // (c) Robert Schuster, 2007
4 //
5 // Licensed under GNU GPL version 2 or, at your option, any later version.
6
7 #ifndef MENUMANAGER_H
8 #define MENUMANAGER_H
9
10 class Main;
11
12 class ControlOptions;
13 class VideoOptions;
14 class GameOptions;
15
16 class MenuSystem;
•17 #include "ui/menuaction.h"
18
19 /**
20 * MenuManager forms the facade for interacting with the game's menus.
21 *
22 * It speaks to MenuSystem and builds up the menus and their menu entries. However
23 * it does not touch any of the guichan internal.
24 *
25 * This is done to keep the guichan integration low and give the menu
26 * construction a dedicated place that is not polluted with low-level stuff.
27 *
28 */
29 class MenuManager
30 {
31 Main &main;
32
33 ControlOptions *controlOptions;
34 VideoOptions *videoOptions;
35 GameOptions *gameOptions;
36
37 MenuSystem *menuSystem;
38
39 public:
40 MenuManager(Main &);
41
42 ~MenuManager();
43
44 void showSinglePlayerMenu();
45 void show();
46 void hide();
47 bool isVisible() const;
48
49 void resize();
50
51 void render();
52
53 bool update();
54
55 /** Indicate that input sensing should be finished.
56 *
57 * If a new input has been determined and the operation should
58 * end as succeeded the argument's value is <code>true</code>.
59 *
60 * If the operation should end as cancelled the argument's value
61 * is <code>false</code>.
62 * */
63 void senseFinished(bool);
64
65 GameOptions &getGameOptions() const { return *gameOptions; };
66
67 VideoOptions &getVideoOptions() const { return *videoOptions; };
68 };
69
•70 class QuitAction : public MenuAction
71 {
72 Main &main;
73
74 public:
75 QuitAction(Main &newMain)
76 : main(newMain) { }
77
78 void invoke();
79 };
80
81 #endif