Debian Codegraph @

Examples/GUIStyle/MenuSystem/NS_MenuManager.h

raw
1 // NS_MenuManager.h: interface for the NS_MenuManager class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_)
6 #define AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <string>
13 #include <map>
14
15 class CL_ResourceManager;
16 class CL_GUIManager;
17 class NS_MenuGeneric;
18 class CL_StyleManager;
19
20 // Menu manager is a main object of the game. It manage all menus
21 // and answer to switching requests from one menu to another
22
23 class NS_MenuManager
24 {
25 public:
26 // In constructor MenuManager creates all menus from resourses
27 // and set curent menu to "menu_main"
28 NS_MenuManager(CL_ResourceManager & resource,
29 CL_StyleManager & style_manager);
30 ~NS_MenuManager();
31 public:
32 // Main loop of the game
33 void run();
34 // Switch request, sended from one of the managed menu
35 // param: menu_name - name of menu to switch on
36 void switch_to(std::string const & menu_name);
37 // Quit from main loop
38 void quit();
39 CL_ResourceManager & get_resource_manager();
40 private:
41 CL_ResourceManager & resource;
42 CL_StyleManager & style_manager;
43
44 typedef std::map<std::string, NS_MenuGeneric * > MCont_t;
45 // This contaner holds all menus connected to Manager
46 MCont_t menus;
47 // Current menu
48 NS_MenuGeneric * current_menu;
49 // Indicator of running main loop
50 bool running;
51 };
52
53 #endif // !defined(AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_)