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

Abstract class for levels. More...

#include <Level.h>

Public Member Functions

virtual ~Level ()
 The destructor. More...
 
unsigned int getWidth ()
 
unsigned int getHeight ()
 
- Public Member Functions inherited from StateGame
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 Member Functions

 Level ()
 The constructor. More...
 
virtual void setPlayer (Player *const player_)
 
virtual void setCamera (Camera *const camera_)
 

Protected Attributes

unsigned int width
 Width that defines the horizontal limits. More...
 
unsigned int height
 Height that defines the vertical limits. More...
 
Playerplayer
 The direct reference to player, even though its in the list. More...
 
Cameracamera
 The current camera for that level. More...
 
TileMaptileMap
 
- Protected Attributes inherited from StateGame
std::vector< Entity * > entities
 List of all the entities in the state. More...
 

Detailed Description

Abstract class for levels.

Contains a background, player and a camera.

Constructor & Destructor Documentation

Level::~Level ( )
virtual

The destructor.

Deletes all the allocated attributes, even though the specific levels should.

Level::Level ( )
protected

The constructor.

Initializes all the attributes.

Member Function Documentation

unsigned int Level::getHeight ( )
Returns
The Level height.
unsigned int Level::getWidth ( )
Returns
The Level width.
void Level::setCamera ( Camera *const  camera_)
protectedvirtual
Parameters
camera_: Sets the camera for the level.
Note
You should only set the camera after setting the player. Will warn if you didn't.
void Level::setPlayer ( Player *const  player_)
protectedvirtual
Parameters
player_: Sets the player for the level.

Member Data Documentation

Camera* Level::camera
protected

The current camera for that level.

unsigned int Level::height
protected

Height that defines the vertical limits.

Player* Level::player
protected

The direct reference to player, even though its in the list.

unsigned int Level::width
protected

Width that defines the horizontal limits.


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