Pacman  1.0
Pacman game
Fonctions membres publiques | Fonctions membres privées | Attributs privés | Liste de tous les membres
Référence de la classe Pacman

Pacman class. Plus de détails...

#include <Pacman.h>

Graphe d'héritage de Pacman:
Inheritance graph
[légende]
Graphe de collaboration de Pacman:
Collaboration graph
[légende]

Fonctions membres publiques

 Pacman (float x, float y, int direction, std::shared_ptr< Intersection > destination)
 
 ~Pacman ()
 
void move ()
 move the pacman Plus de détails...
 
void render (int frame, SDL_Renderer *renderer, SDL_Texture *texture)
 render the pacman Plus de détails...
 
void setPlayerDirection (int d)
 
int getX () const
 
int getY () const
 
void setEating (bool e)
 
bool getEating () const
 
- Fonctions membres publiques hérités de Entity
 Entity (float x, float y, int direction)
 
void setDirection (int d)
 
float getX () const
 
float getY () const
 

Fonctions membres privées

SDL_Rect getSprite (int frame, int direction)
 
std::shared_ptr< IntersectionmakeTurn ()
 return the next intersection Plus de détails...
 

Attributs privés

std::shared_ptr< Intersectiondest
 
std::vector< SDL_Rect > sprites
 
int playerDirection = RIGHT
 
SDL_Rect lastSprite = {489, 1, 13, 13}
 
bool isEating = false
 

Membres hérités additionnels

- Fonctions membres protégées hérités de Entity
bool isAtIntersection (std::shared_ptr< Intersection > dest)
 return wether the entity is at an intersection Plus de détails...
 
- Attributs protégés hérités de Entity
float x
 
float y
 
float speed
 
int direction
 
std::vector< SDL_Rect > sprites
 

Description détaillée

Pacman class.

this class is used to store the pacman entity. It is a subclass of Entity.

Documentation des constructeurs et destructeur

◆ Pacman()

Pacman::Pacman ( float  x,
float  y,
int  direction,
std::shared_ptr< Intersection destination 
)

◆ ~Pacman()

Pacman::~Pacman ( )

Documentation des fonctions membres

◆ getEating()

bool Pacman::getEating ( ) const

◆ getSprite()

SDL_Rect Pacman::getSprite ( int  frame,
int  direction 
)
privatevirtual

Implémente Entity.

◆ getX()

int Pacman::getX ( ) const

◆ getY()

int Pacman::getY ( ) const

◆ makeTurn()

std::shared_ptr< Intersection > Pacman::makeTurn ( )
private

return the next intersection

this method is used to return the next intersection. It also updates the coordinates of the pacman.

Renvoie
std::shared_ptr<Intersection>

◆ move()

void Pacman::move ( )

move the pacman

this method is used to move the pacman. It calls the makeTurn method when the pacman is at an intersection.

◆ render()

void Pacman::render ( int  frame,
SDL_Renderer *  renderer,
SDL_Texture *  texture 
)
virtual

render the pacman

this method is used to render the pacman. It calls the getSprite method to get the correct sprite for the pacman.

Paramètres
frame
renderer
texture

Implémente Entity.

◆ setEating()

void Pacman::setEating ( bool  e)

◆ setPlayerDirection()

void Pacman::setPlayerDirection ( int  d)

Documentation des données membres

◆ dest

std::shared_ptr<Intersection> Pacman::dest
private

◆ isEating

bool Pacman::isEating = false
private

◆ lastSprite

SDL_Rect Pacman::lastSprite = {489, 1, 13, 13}
private

◆ playerDirection

int Pacman::playerDirection = RIGHT
private

◆ sprites

std::vector<SDL_Rect> Pacman::sprites
private

La documentation de cette classe a été générée à partir du fichier suivant :