Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes | List of all members
JAM_Entity Class Referenceabstract

Creates an Entity object. More...

#include <Entity.h>

Inheritance diagram for JAM_Entity:
Inheritance graph
Collaboration diagram for JAM_Entity:
Collaboration graph

Public Member Functions

 JAM_Entity (JAM_Texture *sprite, float x, float y, float width, float height)
 
 ~JAM_Entity ()
 
virtual void update (float dt)=0
 
void draw (SDL_Renderer *renderer)
 
void setPosition (float x, float y)
 
void setPosition (JAM_Vec2 position)
 
void setX (float x)
 
void setY (float y)
 
void setDimensions (float width, float height)
 
void setDimensions (JAM_Vec2 dimensions)
 
void setWidth (float width)
 
void setHeight (float height)
 
JAM_Vec2 getPosition ()
 
JAM_Vec2 getDimensions ()
 

Private Attributes

JAM_Texturesprite
 
JAM_Vec2 position
 
JAM_Vec2 dimensions
 

Detailed Description

Creates an Entity object.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

JAM_Entity::JAM_Entity ( JAM_Texture sprite,
float  x,
float  y,
float  width,
float  height 
)

Constructs the Entity object.

Parameters
spriteA pointer to the objects Texture.
xThe x position of the Entity.
yThe y position of the Entity.
widthThe width of the Entity.
heightThe height of the Entity.
JAM_Entity::~JAM_Entity ( )

Destructs the Entity object.

Member Function Documentation

void JAM_Entity::draw ( SDL_Renderer *  renderer)

Draws the Entity to the screen.

Parameters
rendererA pointer to the SDL renderer.

Here is the call graph for this function:

Here is the caller graph for this function:

JAM_Vec2 JAM_Entity::getDimensions ( )

Getter # Gets the dimensions of the Entity.

Returns
The dimensions of the Entity.

Here is the caller graph for this function:

JAM_Vec2 JAM_Entity::getPosition ( )

Getter # Gets the position of the Entity.

Returns
The position of the Entity.

Here is the caller graph for this function:

void JAM_Entity::setDimensions ( float  width,
float  height 
)

Setter # Sets the dimensions of the Entity.

Parameters
widthThe new width of the Entity.
heightThe new height of the Entity.

Here is the caller graph for this function:

void JAM_Entity::setDimensions ( JAM_Vec2  dimensions)

Setter # Sets the dimensions of the Entity.

Parameters
dimensionsThe new dimensions of the Entity.
void JAM_Entity::setHeight ( float  height)

Setter # Sets the height of the Entity.

Parameters
heightThe new height of the Entity.
void JAM_Entity::setPosition ( float  x,
float  y 
)

Setter # Sets the position of the Entity.

Parameters
xThe new x position of the Entity.
yThe new y position of the Entity.
void JAM_Entity::setPosition ( JAM_Vec2  position)

Setter # Sets the position of the Entity.

Parameters
positionThe new position of the Entity.
void JAM_Entity::setWidth ( float  width)

Setter # Sets the width of the Entity.

Parameters
widthThe new width of the Entity.
void JAM_Entity::setX ( float  x)

Setter # Sets the x position of the Entity.

Parameters
xThe x position of the Entity.
void JAM_Entity::setY ( float  y)

Setter # Sets the y position of the Entity.

Parameters
yThe y position of the Entity.
virtual void JAM_Entity::update ( float  dt)
pure virtual

A pure virtual function that updates the Entity.

Parameters
dtThe delta time.

Implemented in JAM_Button.

Member Data Documentation

JAM_Vec2 JAM_Entity::dimensions
private

The dimensions of the Entity.

JAM_Vec2 JAM_Entity::position
private

The position of the Entity.

JAM_Texture* JAM_Entity::sprite
private

A pointer to the objects Texture.


The documentation for this class was generated from the following files: