Contains variables and functions to be inherited by classes that are about Entities. More...
#include <EB_Entity.h>
Public Member Functions | |
EB_Entity (C_Texture *sprite, C_Vec2 pos, C_Vec2 dimensions, std::string iD, float *universalSpeed) | |
Constructs the Entity object. More... | |
~EB_Entity () | |
Destructs the Entity object. More... | |
virtual void | update (float dt)=0 |
A pure virtual function that updates the Entity. More... | |
virtual void | draw (SDL_Renderer *renderer) |
A virtual function that draws the Entity to the screen. More... | |
void | setPosition (C_Vec2 pos) |
Sets the position of the Entity. More... | |
void | setX (float x) |
Sets the x position of the Entity. More... | |
void | setY (float y) |
Sets the y position of the Entity. More... | |
void | setDimensions (C_Vec2 dimensions) |
Sets the dimensions of the Entity. More... | |
void | setWidth (float width) |
Sets the width of the Entity. More... | |
void | setHeight (float height) |
Sets the height of the Entity. More... | |
C_Vec2 | getPosition () |
Gets the position of the Entity. More... | |
C_Vec2 | getDimensions () |
Gets the dimensions of the Entity. More... | |
Protected Attributes | |
C_Texture * | sprite |
A pointer to the Entity Texture. More... | |
C_Vec2 | pos |
The position of the Entity. More... | |
C_Vec2 | dimensions |
The dimensions of the Entity. More... | |
std::string | iD |
The ID of the type of Entity. More... | |
float * | universalSpeed |
A pointer for the universal speed of the game. More... | |
Contains variables and functions to be inherited by classes that are about Entities.
EB_Entity::EB_Entity | ( | C_Texture * | sprite, |
C_Vec2 | pos, | ||
C_Vec2 | dimensions, | ||
std::string | iD, | ||
float * | universalSpeed | ||
) |
Constructs the Entity object.
sprite | A pointer to the objects Texture. |
pos | The position of the Entity. |
dimensions | The dimensions of the Entity. |
iD | The ID of the Entity type. |
universalSpeed | A pointer for the universal speed of the game. |
EB_Entity::~EB_Entity | ( | ) |
Destructs the Entity object.
|
virtual |
A virtual function that draws the Entity to the screen.
renderer | A pointer to the SDL renderer. |
Reimplemented in UI_Button, EP_Player, EA_FlamingArrow, EB_Animated, and EPU_Health.
C_Vec2 EB_Entity::getDimensions | ( | ) |
Gets the dimensions of the Entity.
C_Vec2 EB_Entity::getPosition | ( | ) |
Gets the position of the Entity.
void EB_Entity::setDimensions | ( | C_Vec2 | dimensions | ) |
Sets the dimensions of the Entity.
dimensions | The new dimensions of the Entity. |
void EB_Entity::setHeight | ( | float | height | ) |
Sets the height of the Entity.
height | The new height of the Entity. |
void EB_Entity::setPosition | ( | C_Vec2 | pos | ) |
Sets the position of the Entity.
position | The new position of the Entity. |
void EB_Entity::setWidth | ( | float | width | ) |
Sets the width of the Entity.
width | The new width of the Entity. |
void EB_Entity::setX | ( | float | x | ) |
Sets the x position of the Entity.
x | The x position of the Entity. |
void EB_Entity::setY | ( | float | y | ) |
Sets the y position of the Entity.
y | The y position of the Entity. |
|
pure virtual |
A pure virtual function that updates the Entity.
dt | The delta time. |
Implemented in UI_Button, EP_Player, EA_FlamingArrow, EB_Animated, EB_VelocityAnimated, EPU_Pickup, EA_PlayerArrow, EB_Velocity, EE_Archer, EE_StormCloud, EP_PlayerArcher, B_Background, EA_ArcherArrow, and EE_StyphBird.
|
protected |
The dimensions of the Entity.
|
protected |
The ID of the type of Entity.
|
protected |
The position of the Entity.
|
protected |
A pointer to the Entity Texture.
|
protected |
A pointer for the universal speed of the game.