2021-04-03 19:14:31 +02:00
|
|
|
#ifndef APPLICATION_H
|
|
|
|
#define APPLICATION_H
|
|
|
|
|
2021-06-23 21:18:33 +02:00
|
|
|
#include <memory>
|
2021-04-03 19:14:31 +02:00
|
|
|
#include <SFML/System/Clock.hpp>
|
2021-04-05 16:17:57 +02:00
|
|
|
#include <SFML/Window/Keyboard.hpp>
|
2021-06-23 21:18:33 +02:00
|
|
|
#include <SFML/Window/Event.hpp>
|
2021-04-03 19:14:31 +02:00
|
|
|
|
2021-07-22 19:33:33 +02:00
|
|
|
#include "game/game.h"
|
|
|
|
#include "gui/state.h"
|
2021-04-04 22:43:12 +02:00
|
|
|
|
2021-04-03 19:14:31 +02:00
|
|
|
class Application
|
|
|
|
{
|
|
|
|
public:
|
2021-07-22 19:33:33 +02:00
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
|
|
|
SPLASH_SCREEN,
|
|
|
|
MAIN_MENU,
|
|
|
|
GAME_PICKER,
|
|
|
|
GAME,
|
|
|
|
EDITOR_PICKER,
|
|
|
|
EDITOR,
|
|
|
|
SETTINGS
|
|
|
|
};
|
|
|
|
|
2021-04-03 19:14:31 +02:00
|
|
|
Application();
|
|
|
|
void run();
|
2021-04-05 16:17:57 +02:00
|
|
|
void input();
|
2021-04-03 19:14:31 +02:00
|
|
|
void update();
|
|
|
|
void draw();
|
|
|
|
|
|
|
|
private:
|
2021-07-22 19:33:33 +02:00
|
|
|
std::stack<std::shared_ptr<GUIState>> _states;
|
2021-04-05 16:17:57 +02:00
|
|
|
sf::RenderWindow _game_window;
|
2021-06-17 21:13:25 +02:00
|
|
|
std::shared_ptr<Game> _game;
|
2021-06-07 20:19:58 +02:00
|
|
|
|
2021-07-22 19:33:33 +02:00
|
|
|
State _state;
|
|
|
|
|
2021-06-11 18:58:44 +02:00
|
|
|
void exec();
|
2021-04-03 19:14:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPLICATION_H
|