#include <level.h>
Public Types | ||||
enum | eState { , kEmpty = 0, kLoaded = 1, kStarted, kRunning, kStopped } | |||
State enums. More... | ||||
Public Member Functions | ||||
Creation methods | ||||
CLevel () | ||||
Create empty. | ||||
CLevel (CXMLNode node) | ||||
Parase level info from xml node. | ||||
~CLevel () | ||||
Remove everything in this level. | ||||
Manage methods | ||||
bool | load (CXMLNode node) | |||
Load in the level description from a file. | ||||
bool | start () | |||
Start up this level. Load in resources (map, ents, etc.) as needed and start level. | ||||
bool | stop () | |||
Stop this level. | ||||
void | remove () | |||
Delete all data pointers controlled by this level. | ||||
eState | state () const | |||
| ||||
bool | update () | |||
Update this level for one frame. | ||||
Game Entity methods | ||||
long | ge_add (CGameEntity *pGameEntity) | |||
Add a game entity object to this level. | ||||
void | ge_remove (const long id) | |||
Remove the GameEntity with the same id. | ||||
void | ge_remove (CGameEntity *pGameEntity) | |||
Remove the GameEntity from the level. | ||||
CGameEntity * | ge_ptr (const unsigned long id) | |||
Get a pointer to a game entity. | ||||
CGameEntity * | ge_ptr (ENTITY *pEnt) | |||
Get a pointer to a game entity. | ||||
bool | ge_valid_id (const unsigned long id) | |||
Is the id passed a valid game entity id. | ||||
int | ge_count () const | |||
| ||||
Game Entity in Focus methods. | ||||
The focus GE is under local player's control. | ||||
void | ge_focus (CGameEntity *pGE) | |||
| ||||
CGameEntity * | ge_focus () | |||
| ||||
Entity Data methods | ||||
int | entityData_count () | |||
bool | entityData_load (CXMLNode node) | |||
bool | entityData_valid (const char *str) | |||
| ||||
CGameEntityData * | entityData_get (const char *str) | |||
|
A level is a collection of entities (models, maps, etc.)
(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.
enum CLevel::eState |
CLevel::CLevel | ( | CXMLNode | node | ) | [inline] |
Parase level info from xml node.
node | XML node containing level data. |
bool CLevel::load | ( | CXMLNode | node | ) |
Load in the level description from a file.
node | XML node |
bool CLevel::start | ( | ) |
Start up this level. Load in resources (map, ents, etc.) as needed and start level.
bool CLevel::stop | ( | ) |
Stop this level.
bool CLevel::update | ( | ) |
Update this level for one frame.
long CLevel::ge_add | ( | CGameEntity * | pGameEntity | ) |
Add a game entity object to this level.
pGameEntity | pointer to a game entity |
void CLevel::ge_remove | ( | const long | id | ) |
Remove the GameEntity with the same id.
id | GameEntity id |
void CLevel::ge_remove | ( | CGameEntity * | pGameEntity | ) |
Remove the GameEntity from the level.
pGameEntity | GameEntity pointer |
CGameEntity * CLevel::ge_ptr | ( | const unsigned long | id | ) |
Get a pointer to a game entity.
id | of the CGameEntity we are looking for. |
CGameEntity * CLevel::ge_ptr | ( | ENTITY * | pEnt | ) |
Get a pointer to a game entity.
pEnt | Pointer to the ENTITY who's structure we are looking for |
id is stored in skill[99]
bool CLevel::ge_valid_id | ( | const unsigned long | id | ) |
Is the id passed a valid game entity id.
id | of the CGameEntity we are looking for. |
int CLevel::entityData_count | ( | ) | [inline] |
Return the number of entity data entries
bool CLevel::entityData_load | ( | CXMLNode | node | ) |
Load in the entity data description from XML node
node | Node with the entity data |