File: NS_MenuManager.h

package info (click to toggle)
clanlib 1.0~svn3827-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,632 kB
  • ctags: 16,580
  • sloc: cpp: 101,591; xml: 6,410; makefile: 1,743; ansic: 463; perl: 424; php: 247; sh: 53
file content (53 lines) | stat: -rw-r--r-- 1,603 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// NS_MenuManager.h: interface for the NS_MenuManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_)
#define AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
#include <map>

class CL_ResourceManager;
class CL_GUIManager;
class NS_MenuGeneric;
class CL_StyleManager;

// Menu manager is a main object of the game. It manage all menus
// and answer to switching requests from one menu to another

class NS_MenuManager
{
public:
    // In constructor MenuManager creates all menus from resourses
    // and set curent menu to "menu_main"
    NS_MenuManager(CL_ResourceManager & resource,
        CL_StyleManager & style_manager);
    ~NS_MenuManager();
public:
    // Main loop of the game
    void run();
    // Switch request, sended from one of the managed menu
    // param: menu_name - name of menu to switch on
    void switch_to(std::string const & menu_name);
    // Quit from main loop
    void quit();
    CL_ResourceManager & get_resource_manager();
private:
    CL_ResourceManager & resource;
    CL_StyleManager & style_manager;

    typedef std::map<std::string, NS_MenuGeneric * > MCont_t;
    // This contaner holds all menus connected to Manager
    MCont_t menus;
    // Current menu
    NS_MenuGeneric * current_menu;
    // Indicator of running main loop
    bool running;
};

#endif // !defined(AFX_NS_MENUMANAGER_H__5EBB7102_97E9_433A_898C_45923769508C__INCLUDED_)