#ifndef PERSONNAGE_H_INCLUDED #define PERSONNAGE_H_INCLUDED #include #include #undef main #include #include "Niveau.h" #include #include #include enum Direction {Arret = 0, Haut = 1, Droite = 2, Bas = 4, Gauche = 8}; enum Controle {local, ordi, distant}; //static int vitesse = 1;// pour changer l'incrementation du a l'operateur += SDL_Rect operator+=(SDL_Rect &pos, Direction dir); bool operator==(SDL_Rect pos1, SDL_Rect pos2); class Personnage { public: virtual ~Personnage(){} virtual void deplacer() = 0; virtual void positionner(SDL_Rect position, bool coordonnee = false) = 0;// pos[0] -> x, pos[1] -> y virtual void afficher(SDL_Surface *ecran); virtual SDL_Rect getPosition(bool coordonnee = 0); protected: SDL_Rect m_pos; Direction m_direction, m_nouvDir; SDL_Surface *m_skin; Niveau *m_terrain; }; #endif // PERSONNAGE_H_INCLUDED