-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScreenList.h
34 lines (29 loc) · 963 Bytes
/
ScreenList.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
#ifndef SCREENLIST_H
#define SCREENLIST_H
#include <vector>
namespace CGameEngine
{
class IMainGame;
class IGameScreen;
/**
* @file ScreenList.h
* @brief A ScreenList holds the IGameScreen objects and provides basic functionality for abstract control of them
*/
class ScreenList
{
public:
ScreenList(IMainGame* game);
~ScreenList();
IGameScreen* getCurrentScreen();
IGameScreen* moveNext();
IGameScreen* movePrevious();
void addScreen(IGameScreen* newScreen);
void destroy();
void setScreen(int nextScreen);
protected:
IMainGame* m_game = nullptr; /**< pointer to main game object */
std::vector<IGameScreen*> m_screens; /**< list of IGameScreen objects */
int m_currentScreenIndex = -1; /**< active IGameScreen based on m_screens (vector) */
};
}
#endif // SCREENLIST_H