2016-04-11 21:38:03 +00:00
|
|
|
#ifndef __SKIZZLE_STATE_HPP__
|
|
|
|
#define __SKIZZLE_STATE_HPP__
|
2016-03-28 15:23:47 +00:00
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
|
2016-04-09 02:36:30 +00:00
|
|
|
class ResourceManager;
|
2016-04-09 23:29:42 +00:00
|
|
|
class Manager;
|
2016-03-28 15:23:47 +00:00
|
|
|
|
|
|
|
/**
|
2016-04-09 13:53:12 +00:00
|
|
|
* Classe abstraite pour les états de jeu
|
2016-03-28 15:23:47 +00:00
|
|
|
*/
|
2016-04-09 13:53:12 +00:00
|
|
|
class State {
|
2016-04-09 02:36:30 +00:00
|
|
|
private:
|
2016-03-30 12:01:41 +00:00
|
|
|
Manager& manager;
|
|
|
|
|
2016-03-28 15:23:47 +00:00
|
|
|
public:
|
2016-04-09 13:53:12 +00:00
|
|
|
State(Manager& manager);
|
|
|
|
virtual ~State();
|
2016-03-28 17:57:55 +00:00
|
|
|
|
2016-03-28 15:23:47 +00:00
|
|
|
/**
|
2016-04-09 21:57:23 +00:00
|
|
|
* Traite l'événement donné
|
|
|
|
*/
|
|
|
|
virtual void processEvent(const sf::Event& event) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Demande le dessin d'une frame
|
2016-03-28 15:23:47 +00:00
|
|
|
*/
|
2016-04-09 21:57:23 +00:00
|
|
|
virtual void frame() = 0;
|
2016-04-09 02:36:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupère le gestionnaire
|
|
|
|
*/
|
|
|
|
Manager& getManager();
|
|
|
|
|
2016-04-09 23:29:42 +00:00
|
|
|
/**
|
|
|
|
* Récupère le gestionnaire (version constante)
|
|
|
|
*/
|
|
|
|
const Manager& getManager() const;
|
|
|
|
|
2016-04-09 02:36:30 +00:00
|
|
|
/**
|
|
|
|
* Récupère le gestionnaire de ressources
|
|
|
|
*/
|
|
|
|
ResourceManager& getResourceManager();
|
|
|
|
|
2016-04-09 23:29:42 +00:00
|
|
|
/**
|
|
|
|
* Récupère le gestionnaire de ressources (version constante)
|
|
|
|
*/
|
|
|
|
const ResourceManager& getResourceManager() const;
|
|
|
|
|
2016-04-09 02:36:30 +00:00
|
|
|
/**
|
|
|
|
* Récupère la fenêtre
|
|
|
|
*/
|
|
|
|
sf::RenderWindow& getWindow();
|
|
|
|
|
|
|
|
/**
|
2016-04-09 23:29:42 +00:00
|
|
|
* Récupère la fenêtre (version constante)
|
2016-04-09 02:36:30 +00:00
|
|
|
*/
|
2016-04-09 23:29:42 +00:00
|
|
|
const sf::RenderWindow& getWindow() const;
|
2016-03-28 15:23:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|