You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
648 B
C++

#ifndef STATE_H
#define STATE_H
#include <SFML/System.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <memory>
class Application;
class State
{
public:
explicit State(sf::RenderWindow& window, Application *application);
virtual ~State() = 0;
virtual void draw() = 0;
virtual bool update(const sf::Time& dt) = 0;
virtual bool processInput() = 0;
enum class Tag
{
Menu,
Game
};
protected:
sf::RenderWindow& render_window;
Application *app;
};
using StateUPtr = std::unique_ptr<State>;
using StateSPtr = std::shared_ptr<State>;
#endif // STATE_H