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

Entity class. Plus de détails...

#include <Entity.h>

Graphe d'héritage de Entity:
Inheritance graph
[légende]

Fonctions membres publiques

 Entity (float x, float y, int direction)
 
virtual void render (int frame, SDL_Renderer *renderer, SDL_Texture *texture)=0
 render the entity Plus de détails...
 
void setDirection (int d)
 
float getX () const
 
float getY () const
 

Fonctions membres protégées

virtual SDL_Rect getSprite (int frame, int direction)=0
 
bool isAtIntersection (std::shared_ptr< Intersection > dest)
 return wether the entity is at an intersection Plus de détails...
 

Attributs protégés

float x
 
float y
 
float speed
 
int direction
 
std::vector< SDL_Rect > sprites
 

Description détaillée

Entity class.

this class is used to store the entities (pacman and ghosts). It is an abstract class.

Documentation des constructeurs et destructeur

◆ Entity()

Entity::Entity ( float  x,
float  y,
int  direction 
)

Documentation des fonctions membres

◆ getSprite()

virtual SDL_Rect Entity::getSprite ( int  frame,
int  direction 
)
protectedpure virtual

Implémenté dans Pacman, et Ghosts.

◆ getX()

float Entity::getX ( ) const

◆ getY()

float Entity::getY ( ) const

◆ isAtIntersection()

bool Entity::isAtIntersection ( std::shared_ptr< Intersection dest)
protected

return wether the entity is at an intersection

Paramètres
dest
Renvoie
true
false

◆ render()

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

render the entity

this method is used to render the entity. It is a pure virtual method. It is implemented in the subclasses.

Paramètres
frame
renderer
texture

Implémenté dans Pacman, et Ghosts.

◆ setDirection()

void Entity::setDirection ( int  d)

Documentation des données membres

◆ direction

int Entity::direction
protected

◆ speed

float Entity::speed
protected

◆ sprites

std::vector<SDL_Rect> Entity::sprites
protected

◆ x

float Entity::x
protected

◆ y

float Entity::y
protected

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