2021-04-03 13:14:31 -04:00
|
|
|
#ifndef APPLICATION_H
|
|
|
|
#define APPLICATION_H
|
|
|
|
|
2021-06-23 15:18:33 -04:00
|
|
|
#include <memory>
|
2021-08-03 14:42:58 -04:00
|
|
|
#include <array>
|
2021-04-03 13:14:31 -04:00
|
|
|
#include <SFML/System/Clock.hpp>
|
2021-04-05 10:17:57 -04:00
|
|
|
#include <SFML/Window/Keyboard.hpp>
|
2021-06-23 15:18:33 -04:00
|
|
|
#include <SFML/Window/Event.hpp>
|
2021-04-03 13:14:31 -04:00
|
|
|
|
2021-07-22 13:33:33 -04:00
|
|
|
#include "game/game.h"
|
|
|
|
#include "gui/state.h"
|
2021-04-04 16:43:12 -04:00
|
|
|
|
2021-08-26 13:41:16 -04:00
|
|
|
#include "tools/resourceholder.h"
|
|
|
|
|
2021-04-03 13:14:31 -04:00
|
|
|
class Application
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Application();
|
|
|
|
void run();
|
2021-04-05 10:17:57 -04:00
|
|
|
void input();
|
2021-04-03 13:14:31 -04:00
|
|
|
void update();
|
|
|
|
void draw();
|
|
|
|
|
|
|
|
private:
|
2021-08-03 14:42:58 -04:00
|
|
|
std::array<std::shared_ptr<GUIState>, GUIState::Tag::AMOUNT> _states;
|
|
|
|
std::vector<std::shared_ptr<GUIState>> _state_stack;
|
|
|
|
|
2021-04-05 10:17:57 -04:00
|
|
|
sf::RenderWindow _game_window;
|
2021-06-17 15:13:25 -04:00
|
|
|
std::shared_ptr<Game> _game;
|
2021-06-07 14:19:58 -04:00
|
|
|
|
2021-06-11 12:58:44 -04:00
|
|
|
void exec();
|
2021-08-26 12:54:30 -04:00
|
|
|
void pushState(GUIState::Tag new_state);
|
|
|
|
void popState();
|
2021-08-26 13:41:16 -04:00
|
|
|
|
|
|
|
FontHolder _font_holder;
|
2021-04-03 13:14:31 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPLICATION_H
|