Define a gameobject map to render background image. More...
#include <Map.h>
Public Member Functions | |
Map () | |
Constructor. More... | |
void | Update (int x, int y, int *params) override |
Update the position of image in the map. More... | |
void | Render (SDL_Renderer *ren) override |
Render the background image to the active viewport. More... | |
int * | getTileArr () |
Get current tile array. More... | |
void | setEnemies (std::vector< GameObject * > &currEnemies) |
void | resetEnemies () |
reset all active enemies to valid pos and plan new paths More... | |
void | clearEnemies () |
clear all active enemies (deactivate) More... | |
Public Member Functions inherited from GameObject | |
GameObject () | |
Constructor. More... | |
~GameObject () | |
Destructor. More... | |
virtual void | processInput (SDL_Event e) |
Virtual method. Process user input. More... | |
void | removeComponent (std::string key) |
Remove a component in this gameobject. More... | |
void | addComponent (std::string key, Component *component) |
Add a component in this gameobject. More... | |
Component * | getComponent (std::string key) |
Get an reference of a component. More... | |
void | setActive (bool newState) |
activate / deactivate game object. inactive object won't be updated and rendered More... | |
bool | isActive () |
Get the state of the game. More... | |
int | getID () |
Get the unique id of the gameobject. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from GameObject | |
static int | idCounter = 0 |
Protected Attributes inherited from GameObject | |
std::map< std::string, Component * > | m_components |
Store all the game components in a map. More... | |
bool | objState |
deactivated objects won't get updated/rendered More... | |
int | id |
the unique id More... | |
Define a gameobject map to render background image.
Map::Map | ( | ) |
Constructor.
void Map::clearEnemies | ( | ) |
clear all active enemies (deactivate)
int * Map::getTileArr | ( | ) |
Get current tile array.
|
overridevirtual |
Render the background image to the active viewport.
ren | Reference to SDL renderer. |
Reimplemented from GameObject.
void Map::resetEnemies | ( | ) |
reset all active enemies to valid pos and plan new paths
|
inline |
|
overridevirtual |
Update the position of image in the map.
x | The x location of the background image. |
y | The x location of the background image. |
params | An int array stores additional data. |
Reimplemented from GameObject.