-
Notifications
You must be signed in to change notification settings - Fork 0
/
IGameState.h
57 lines (51 loc) · 2.04 KB
/
IGameState.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
//////////////////////////////////////////////////////////////////////////
// Filename : IGameState.h
//
// Author : Ramon Johannessen (RJ)
//
// Purpose : Abstract Base Class for all game states
//////////////////////////////////////////////////////////////////////////
#ifndef IGAMESTATE_H
#define IGAMESTATE_H
class IGameState
{
private:
IGameState(const IGameState&);
IGameState& operator= (const IGameState&);
public:
IGameState() {};
virtual ~IGameState() = 0 {}
//////////////////////////////////////////////////////////////////////////
// Function : Update
//
// Purpose : Any update code goes here, pure virtual, must be overwritten
//////////////////////////////////////////////////////////////////////////
virtual void Update(float fElapsedTime) = 0;
//////////////////////////////////////////////////////////////////////////
// Function : Render
//
// Purpose : draw everything to the screen, pure virtual, must be overwritten
//////////////////////////////////////////////////////////////////////////
virtual void Render() = 0;
//////////////////////////////////////////////////////////////////////////
// Function : Input
//
// Purpose : Handle any user input, mouse or keyboard, pure virtual, must be overwritten
//
// Return : true/false, false if we are exiting the game
//////////////////////////////////////////////////////////////////////////
virtual bool Input() = 0;
//////////////////////////////////////////////////////////////////////////
// Function : Enter
//
// Purpose : When the state is first entered, execute this code, pure virtual, must be overwritten
//////////////////////////////////////////////////////////////////////////
virtual void Enter() = 0;
//////////////////////////////////////////////////////////////////////////
// Function : Exit
//
// Purpose : When the state exits, execute this code, pure virtual, must be overwritten
//////////////////////////////////////////////////////////////////////////
virtual void Exit() = 0;
};
#endif