2016-03-08 22:28:50 +00:00
|
|
|
#ifndef __PTF_ENGINE_HPP__
|
|
|
|
#define __PTF_ENGINE_HPP__
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
2016-03-08 18:51:42 +00:00
|
|
|
#include "object.hpp"
|
2016-03-13 16:03:56 +00:00
|
|
|
#include "engine_state.hpp"
|
2016-03-22 19:04:18 +00:00
|
|
|
#include "resource_manager.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;
|
2016-03-22 19:04:18 +00:00
|
|
|
sf::View view;
|
|
|
|
|
2016-03-13 16:03:56 +00:00
|
|
|
EngineState state;
|
2016-03-22 19:04:18 +00:00
|
|
|
ResourceManager resources;
|
2016-03-08 18:51:42 +00:00
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
/**
|
|
|
|
* Met à jour les objets du jeu pour
|
|
|
|
* qu'ils s'adaptent au nouvel état du moteur
|
|
|
|
*/
|
|
|
|
void update();
|
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
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
public:
|
|
|
|
Engine();
|
|
|
|
|
2016-03-08 18:51:42 +00:00
|
|
|
/**
|
2016-03-09 18:35:40 +00:00
|
|
|
* Démarre la boucle principale du jeu
|
2016-03-08 18:51:42 +00:00
|
|
|
*/
|
2016-03-09 18:35:40 +00:00
|
|
|
void start();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ajoute un nouvel objet à la liste des objets du jeu
|
|
|
|
*/
|
2016-03-12 18:45:16 +00:00
|
|
|
void addObject(Object& object);
|
2016-03-04 15:29:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2016-03-25 17:40:39 +00:00
|
|
|
|