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

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

#include <MapSquare.h>

Inheritance diagram for MapSquare:
Inheritance graph
Collaboration diagram for MapSquare:
Collaboration graph

Public Member Functions

 MapSquare (JAM_Texture *sprite, float x, float y, float width, float height, bool danger)
 
 ~MapSquare ()
 
void update (float dt)
 
void setDanger (bool danger)
 
bool getDanger ()
 
- Public Member Functions inherited from JAM_Entity
 JAM_Entity (JAM_Texture *sprite, float x, float y, float width, float height)
 
 ~JAM_Entity ()
 
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

bool danger
 

Detailed Description

Creates a MapSquare object that inherits Entity.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

MapSquare::MapSquare ( JAM_Texture sprite,
float  x,
float  y,
float  width,
float  height,
bool  danger 
)

Constructs the MapSquare object.

Parameters
spriteA pointer to the objects Texture.
xThe x position of the MapSquare.
yThe y position of the MapSquare.
widthThe width of the MapSquare.
heightThe height of the MapSquare.
dangerA Boolean for if the square is dangerous.
MapSquare::~MapSquare ( )

Destructs the MapSquare object.

Member Function Documentation

bool MapSquare::getDanger ( )

Getter # Get the danger boolean.

Returns
If the MapSquare is dangerous.
void MapSquare::setDanger ( bool  danger)

Setter # Set the danger boolean.

Parameters
dangerIf the MapSquare is dangerous.
void MapSquare::update ( float  dt)
virtual

A function that updates the MapSquare.

Parameters
dtThe delta time.

Implements JAM_Entity.

Member Data Documentation

bool MapSquare::danger
private

A Boolean for if the square is dangerous.


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