-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathScreen.h
112 lines (90 loc) · 2.75 KB
/
Screen.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef SCREEN_H
#define SCREEN_H
#include <SdkTrays.h>
#include <entityx.h>
#include "Singleton.h"
class Screen : public OgreBites::SdkTrayListener
{
public:
Screen() {}
virtual void enter() = 0;
virtual void pause() = 0;
virtual void resume() = 0;
virtual void leave() = 0;
virtual void update(double dt) = 0;
virtual void keyPressed(const OIS::KeyEvent &evt) = 0;
virtual void keyReleased(const OIS::KeyEvent &evt) = 0;
virtual void mouseMoved(const OIS::MouseEvent &evt);
virtual void mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
virtual void mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
entityx::ptr<entityx::EntityManager> getEntities() { return mEntities; }
OgreBites::SdkTrayManager *getTrayMgr() { return mTrayMgr; }
protected:
entityx::ptr<entityx::EntityManager> mEntities;
OgreBites::SdkTrayManager *mTrayMgr;
};
class MenuScreen : public Screen, public Singleton<MenuScreen>
{
public:
MenuScreen(){}
void enter();
void pause();
void resume();
void leave();
void update(double dt);
void buttonHit(OgreBites::Button *button);
void yesNoDialogClosed(const Ogre::DisplayString &question, bool yesHit);
void keyPressed(const OIS::KeyEvent &evt);
void keyReleased(const OIS::KeyEvent &evt);
private:
bool change;
};
class PlayScreen : public Screen, public Singleton<PlayScreen>
{
public:
PlayScreen() {}
void enter();
void pause();
void resume();
void leave();
void update(double dt);
void keyPressed(const OIS::KeyEvent &evt);
void keyReleased(const OIS::KeyEvent &evt);
void mouseMoved(const OIS::MouseEvent &evt);
void mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
void mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
private:
OgreBites::ParamsPanel *mInfoPanel;
OgreBites::ProgressBar *mHealthBar;
OgreBites::ProgressBar *mHeatBar;
};
class PauseScreen : public Screen, public Singleton<PauseScreen>
{
public:
PauseScreen() {}
void enter();
void pause();
void resume();
void leave();
void update(double dt);
void keyPressed(const OIS::KeyEvent &evt);
void keyReleased(const OIS::KeyEvent &evt);
void buttonHit(OgreBites::Button *button);
void yesNoDialogClosed(const Ogre::DisplayString &question, bool yesHit);
};
class GameOverScreen : public Screen, public Singleton<GameOverScreen>
{
public:
GameOverScreen() {}
void enter();
void pause();
void resume();
void leave();
void update(double dt);
void keyPressed(const OIS::KeyEvent &evt);
void keyReleased(const OIS::KeyEvent &evt);
private:
const double screenDuration = 5;
double mTime;
};
#endif // SCREEN_H