12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef NIVEAU_H_INCLUDED
- #define NIVEAU_H_INCLUDED
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <SDL/SDL.h>
- #undef main
- #define LG_BLOC 30
- #define LG_TABL 20
- enum axe {Y=0,X=1};
- enum bloc {RIEN=0,MUR=1,PLAQUE=2,SPAWN_ALLIE=3,SPAWN_PHANTOM=4};
- enum item {VIDE=0,STEACK=1,TONNEAU=2};
- class Niveau
- {
- public:
- Niveau();
- Niveau(std::string nomFichier, Uint16 fraction = 0);
- ~Niveau();
-
- int peindreFont(Uint16 fraction);
- bool creer(std::string nomFichier, Uint16 fraction = 0);
- void afficher(SDL_Surface* support, bool hideItem=0);
-
- void remplirItems();
- short typeBloc(int x, int y, bool coordonee = 0);
- short takeItem(int x, int y, bool coordonee = 0);
- int itemsRestants();
- int popFantom(axe choisi);
- int popAllie(axe choisi);
- int getEffectifMobs();
-
- std::string getNom();
- void save(int effectifPhantom);
- void placeBloc(short blocChoisi, int x, int y, Uint32 couleur, bool coordonee = 0);
- void reset();
- private:
- SDL_Surface* m_font;
- SDL_Surface* m_items;
- std::string m_nom;
- std::string m_nomFichier;
- int m_lvlNumber;
- short m_itemTabl[LG_TABL][LG_TABL];
- short m_tabl[LG_TABL][LG_TABL];
- int m_effectifItems;
- short m_effectifMobs;
- int m_spawnPhantom[2];
- int m_spawnAllie[2];
- };
- #endif
|