-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.h
62 lines (42 loc) · 1.15 KB
/
Application.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
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <map>
#include "Singleton.h"
#include "GameState.h"
class GraphicsManager;
class UserEventsHandler;
class NetworkProcessor;
enum GameStateEnum{
SplashScreenState = 1,
LoadingScreenState,
MainMenuState,
InGameState
};
class Application: public Singleton<Application>
{
public:
void run();
void loop(sf::Uint16 gameState);
void setCurrentGameState(sf::Uint16 gameState);
sf::Uint16 getCurrentGameState();
GameState* getGameState(sf::Uint16 gameState);
sf::Font& getDefaultFont();
sf::RenderWindow* getRenderWindow();
static GraphicsManager* graphicsManager();
static UserEventsHandler* eventsHandler();
static NetworkProcessor* networkProcessor();
private:
Application();
GraphicsManager* m_graphicsManagers;
UserEventsHandler* m_userEventsHandler;
NetworkProcessor* m_networkProcessor;
sf::RenderWindow* m_window;
sf::Uint16 m_gameState;
std::map<sf::Uint16, GameState*> m_gameStates;
sf::Font m_defaultFont;
friend class Singleton<Application>;
};
#endif // MAIN_H_INCLUDED