Space Sheep Xtreme Turbo Penguin Edition
GameModel.h
Aller à la documentation de ce fichier.
1 #ifndef GAMEMODEL_H
2 #define GAMEMODEL_H
3 
11 #include "Tir.h"
12 #include "Ennemi.h"
13 #include "Boss.h"
14 #include "Joueur.h"
15 #include "Bonus.h"
16 #include "Niveau.h"
17 #include "Horloge.h"
18 
19 #include <vector>
20 #include <string>
21 #include <sstream>
22 
23 using namespace std;
24 
32 class GameModel
33 {
34  private :
35 
36  int my_score;
37  int my_viesMax;
38  int my_difficulty;
39 
40  Joueur *my_ship;
41  vector<Tir*> my_tirs;
42  vector<Ennemi*> my_ennemis;
43  vector<Bonus*> my_bonuses;
44  vector<MovableElement*> my_deletedItems;
45 
46  TypeEnnemi* my_ennemi_types[NB_ENNEMY_TYPES];
47  TypeTir* my_tirs_types[NB_TIRS_TYPES];
48  TypeBonus* my_bonuses_types[NB_BONUS_TYPES];
49  TypeBoss* my_boss_type;
50 
51  Boss *b;
52 
53 
54  Niveau niveau;
55  map<float, TypeEnnemi*>::const_iterator itNiveau;
56  bool my_nextLevel;
57 
58  Horloge my_clock;
59 
60 
61  public :
62 
70  GameModel(int viesMax, int initialLives, int difficulty);
71 
75  ~GameModel();
76 
82  void nextStep();
83 
84 
90  void addEnnemy(TypeEnnemi* type);
91 
97  void addTir(Tir* t);
98 
105  void addBonus(int x, int y);
106 
107 
113  void removeEnnemy(Ennemi* ennemi);
114 
120  void removeEnnemy(std::vector<Ennemi*>::iterator it);
121 
122 
128  void saveScore(string name);
129 
130 
136  void changeNiveau();
137 
143  void gameOver();
144 
145 
146  //Accesseurs
147 
156  void getShipPos(int &x, int &y) const;
157 
165  bool getNextLevel() const;
166 
174  int getLevelID() const;
175 
183  int getScore() const;
184 
192  int getDifficulty() const;
193 
201  string getStringLevelID() const;
202 
210  string getStringScore() const;
211 
212 
220  TypeEnnemi* const* getEnnemyTypes() const;
221 
229  TypeTir* const* getTirTypes() const ;
230 
238  TypeBoss* getBossType() const;
239 
240 
248  Joueur* getPlayerShip() const;
249 
250 
258  vector<Ennemi*>* getVectorEnnemis();
259 
267  vector<Tir*>* getVectorTir();
268 
276  const vector<Bonus*> & getVectorBonuses();
277 
285  vector<MovableElement*>* getDeletedItems();
286 
287 
295  Horloge* getClock();
296 
297 
302  void setScore(int score);
303 
308  void setNextLevel(bool nextLvl);
309 
310 };
311 
312 #endif