Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
Public Member Functions | Protected Attributes | List of all members
MapObject Class Reference

Creates a MapObject object that inherits Entity. More...

#include <mapObject.h>

Inheritance diagram for MapObject:
Inheritance graph
Collaboration diagram for MapObject:
Collaboration graph

Public Member Functions

 MapObject (Texture *, float, float)
 
 ~MapObject ()
 
void setCollidable (bool)
 
bool getCollidable ()
 
void setDamaging (bool)
 
bool getDamaging ()
 
void setDeletable (bool)
 
bool getDeletable ()
 
void setVelocity (float)
 
void updateX (float)
 
float getVelocity ()
 
- Public Member Functions inherited from Entity
 Entity (Texture *, float, float, int, int)
 
 ~Entity ()
 
void display (SDL_Renderer *)
 
void setX (float)
 
void setY (float)
 
float getX ()
 
float getY ()
 
void setSrcX (float)
 
void setSrcY (float)
 
int getSrcX ()
 
int getSrcY ()
 

Protected Attributes

bool collidable
 
bool damaging
 
bool deleteable
 
float velocity
 
int minX
 
int maxX
 
bool moveable
 
- Protected Attributes inherited from Entity
Texturetexture
 
int srcWidth
 
int srcHeight
 
int srcX
 
int srcY
 
int width
 
int height
 
float x
 
float y
 

Detailed Description

Creates a MapObject object that inherits Entity.

Constructor & Destructor Documentation

MapObject::MapObject ( Texture inputTexture,
float  inputX,
float  inputY 
)

Constructs a MapObject object Constructs the MapObject object.

Parameters
Texture*a pointer to a Texture loaded into memory.
floatinitial x position.
floatinitial y position.
MapObject::~MapObject ( )

De-constructs a MapObject object De-constructs the MapObject object

Member Function Documentation

bool MapObject::getCollidable ( )

Getter # collidable Gets if the object is collidable

Returns
bool if the mapObject is collidable.
bool MapObject::getDamaging ( )

Getter # damaging

Returns
bool if the object causes damaging to the player.
bool MapObject::getDeletable ( )

Getter # deleteable

Returns
bool does the object need deleting.

Here is the caller graph for this function:

float MapObject::getVelocity ( )

Getter # velocity

Returns
the velocity of the MapObject.

Here is the caller graph for this function:

void MapObject::setCollidable ( bool  inputCollidable)

Setter # collidable Sets if the object is able to be collided with.

Parameters
boolthe collision boolean
void MapObject::setDamaging ( bool  inputDamaging)

Setter # damaging Sets if the object causes damaging to the player.

Parameters
boolthe object causes damaging to the player.
void MapObject::setDeletable ( bool  inputDelete)

Setter # deleteable Sets if the object needs to be deleted.

Parameters
booldoes the object need deleting.

Here is the caller graph for this function:

void MapObject::setVelocity ( float  inputVelocity)

Setter # velocity Sets the velocity of the MapObject to the inputed velocity.

Parameters
floatthe inputed velocity

Here is the caller graph for this function:

void MapObject::updateX ( float  dt)

Updates the x position of the MapObject Performers a check on the updated position of the x to see if it within boundaries. If it is within boundaries then it updates the x position using the velocity and the inputed deltaTime. If it is not within boundaries then it resets the x position to the boundaries.

Parameters
floatthe inputed deltaTime

Here is the caller graph for this function:


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