Dauphine  0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
Public Member Functions | Protected Attributes | List of all members
StateGame Class Referenceabstract

Parent class for other game states. More...

#include <StateGame.h>

Public Member Functions

virtual ~StateGame ()
 The destructor.
 
virtual void load ()=0
 Loads necessary objects. More...
 
virtual void update (const double dt_)=0
 Update all entities. More...
 
virtual void unload ()=0
 Unloads necessary objects. More...
 
virtual void render ()=0
 Renders the level. More...
 
void addEntity (Entity *const entity)
 Adds an entity to the vector.
 
void cleanEntities ()
 Deletes all the entities inside the vector.
 

Protected Attributes

std::vector< Entity * > entities
 List of all the entities in the state. More...
 

Detailed Description

Parent class for other game states.

Member Function Documentation

virtual void StateGame::load ( )
pure virtual

Loads necessary objects.

Pure virtual function. Purpose is to load all things relevant to the state.

Implemented in GStateSplash, GStateCredits, GStateGameOver, GStateMenu, GStateOptions, and LevelOne.

virtual void StateGame::render ( )
pure virtual

Renders the level.

Always render on 0,0 position.

See Also
Sprite::render()

Implemented in GStateSplash, GStateCredits, GStateGameOver, GStateMenu, GStateOptions, and LevelOne.

virtual void StateGame::unload ( )
pure virtual

Unloads necessary objects.

Pure virtual function. Purpose is to unload whatever was previously loaded.

Implemented in GStateSplash, GStateCredits, GStateGameOver, GStateMenu, GStateOptions, and LevelOne.

virtual void StateGame::update ( const double  dt_)
pure virtual

Update all entities.

Pure virtual function. Purpose is to update all the entities in the vector.

Parameters
dt_: Delta time. Time elapsed between one frame and the other.

Implemented in GStateSplash, GStateCredits, GStateGameOver, GStateMenu, GStateOptions, and LevelOne.

Member Data Documentation

std::vector<Entity*> StateGame::entities
protected

List of all the entities in the state.


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