2016-03-04 15:29:31 +00:00
|
|
|
#ifndef PTF_ENGINE_HPP
|
|
|
|
#define PTF_ENGINE_HPP
|
|
|
|
|
|
|
|
#include <vector>
|
2016-03-08 18:51:42 +00:00
|
|
|
#include <memory>
|
2016-03-04 15:29:31 +00:00
|
|
|
#include <SFML/Graphics.hpp>
|
2016-03-08 18:51:42 +00:00
|
|
|
#include "state.hpp"
|
|
|
|
#include "object.hpp"
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* La classe principale Engine coordonne les éléments
|
|
|
|
* du jeu et organise le dessin des frames
|
|
|
|
*/
|
|
|
|
class Engine {
|
|
|
|
private:
|
|
|
|
sf::Clock clock;
|
|
|
|
sf::RenderWindow window;
|
|
|
|
|
|
|
|
bool goLeftKey;
|
|
|
|
bool goRightKey;
|
|
|
|
|
2016-03-08 18:51:42 +00:00
|
|
|
std::vector<std::unique_ptr<Object>> objects;
|
|
|
|
|
2016-03-04 15:29:31 +00:00
|
|
|
public:
|
|
|
|
Engine();
|
2016-03-08 18:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dessine la scène du jeu couche par couche
|
|
|
|
*/
|
2016-03-04 15:29:31 +00:00
|
|
|
void draw();
|
2016-03-08 18:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Met à jour les objets du jeu pour
|
|
|
|
* qu'ils s'adaptent au nouvel état du moteur
|
|
|
|
*/
|
|
|
|
void update(State state);
|
2016-03-04 15:29:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|