-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameStateMgr.h
64 lines (45 loc) · 1.23 KB
/
GameStateMgr.h
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
54
55
56
57
58
59
60
61
62
63
64
#ifndef __ARK_GAME_STATE_MGR_H__
#define __ARK_GAME_STATE_MGR_H__
/*
Project: Arkanoid
Programmer: Jacek "TeMPOraL" Zlydach [temporal@poczta.fm]
Created: 23.03.2004
Last Revised: 23.03.2004
Implementation File: GameStateMgr.cpp
Notes:
*/
/*
*/
#include "GameState.h"
enum GAME_STATES
{
GS_NONE = 0,
GS_INTRO = GS_NONE - 1,
GS_MAINMENU = GS_NONE - 2,
GS_NORMAL_GAME = GS_NONE - 3,
GS_TIMEATTACK_GAME = GS_NONE - 4,
GS_SURVIVAL_GAME = GS_NONE -5,
GS_GRAVITY_GAME = GS_NONE - 6,
GS_CREDITS = GS_NONE - 7,
GS_TEST = 255
};
namespace ARK
{
class CGameStateMgr
{
private:
GAME_STATES currentState; //current state
GAME_STATES newState; //new state to be set
CGameState * state; //state object
bool bShouldChangeState; //should the Game State Manager change state?
void ChangeState(); //do a state change
public:
CGameStateMgr():state(NULL), currentState(GS_NONE), newState(GS_NONE), bShouldChangeState(false){}
~CGameStateMgr(){}
bool Init(); //initialize
bool Update(float deltaT); //update
bool DeInit(); //deinitialize
bool SetState(GAME_STATES newState);
}; //end of class CGameStateMgr
} //end of namespace ARK
#endif //_ARK_GAME_STATE_MGR_H_