2016-03-28 13:05:18 +00:00
|
|
|
#ifndef __PTF_GAME_HPP__
|
|
|
|
#define __PTF_GAME_HPP__
|
2016-03-04 15:29:31 +00:00
|
|
|
|
2016-03-26 09:08:13 +00:00
|
|
|
#include <SFML/Audio.hpp>
|
2016-03-28 15:23:47 +00:00
|
|
|
#include "view.hpp"
|
2016-03-08 18:51:42 +00:00
|
|
|
#include "object.hpp"
|
2016-03-28 15:23:47 +00:00
|
|
|
#include "manager.hpp"
|
2016-03-22 19:04:18 +00:00
|
|
|
#include "resource_manager.hpp"
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
/**
|
2016-03-28 13:05:18 +00:00
|
|
|
* La classe Game gère l'affichage et les objets
|
|
|
|
* d'une partie de jeu
|
2016-03-04 15:29:31 +00:00
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
class Game : public View {
|
2016-03-04 15:29:31 +00:00
|
|
|
private:
|
2016-03-22 19:04:18 +00:00
|
|
|
sf::View view;
|
2016-03-26 09:08:13 +00:00
|
|
|
sf::Music music;
|
2016-03-22 19:04:18 +00:00
|
|
|
|
2016-03-28 15:23:47 +00:00
|
|
|
float accumulator;
|
|
|
|
std::vector<Object*> objects;
|
2016-03-08 18:51:42 +00:00
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
/**
|
|
|
|
* Met à jour les objets du jeu pour
|
2016-03-28 13:05:18 +00:00
|
|
|
* qu'ils s'adaptent au nouvel état
|
2016-03-09 18:35:40 +00:00
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
void update(const Manager& manager);
|
2016-03-08 18:51:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dessine la scène du jeu couche par couche
|
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
void draw(Manager& manager);
|
2016-03-08 18:51:42 +00:00
|
|
|
|
2016-03-09 18:35:40 +00:00
|
|
|
public:
|
2016-03-28 13:05:18 +00:00
|
|
|
Game();
|
2016-03-09 18:35:40 +00:00
|
|
|
|
2016-03-08 18:51:42 +00:00
|
|
|
/**
|
2016-03-28 15:23:47 +00:00
|
|
|
* Demande le passage à la frame suivante sur
|
|
|
|
* cette vue
|
2016-03-08 18:51:42 +00:00
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
void frame(Manager& manager);
|
2016-03-09 18:35:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|