FIFE
2008.0
|
#include <model.h>
Public Member Functions | |
Model (RenderBackend *renderbackend, const std::vector< RendererBase * > &renderers) | |
~Model () | |
Map * | createMap (const std::string &identifier) |
void | deleteMap (Map *) |
const std::list< Map * > & | getMaps () const |
Map * | getMap (const std::string &identifier) const |
uint32_t | getMapCount () const |
void | deleteMaps () |
std::list< std::string > | getNamespaces () const |
Object * | createObject (const std::string &identifier, const std::string &name_space, Object *parent=0) |
bool | deleteObject (Object *) |
bool | deleteObjects () |
Object * | getObject (const std::string &id, const std::string &name_space) |
std::list< Object * > | getObjects (const std::string &name_space) const |
void | adoptPather (IPather *pather) |
IPather * | getPather (const std::string &pathername) |
void | adoptCellGrid (CellGrid *grid) |
CellGrid * | getCellGrid (const std::string &gridtype) |
void | update () |
void | setTimeMultiplier (float multip) |
double | getTimeMultiplier () const |
![]() | |
fifeid_t | getFifeId () |
FIFE::Model::Model | ( | RenderBackend * | renderbackend, |
const std::vector< RendererBase * > & | renderers | ||
) |
void FIFE::Model::adoptCellGrid | ( | CellGrid * | grid) |
Adds cellgrid to model. Moves ownership to model
Definition at line 92 of file model.cpp.
Referenced by FIFE::Engine::init().
void FIFE::Model::adoptPather | ( | IPather * | pather) |
Adds pather to model. Moves ownership to model
Definition at line 77 of file model.cpp.
Referenced by FIFE::Engine::init().
Map * FIFE::Model::createMap | ( | const std::string & | identifier) |
Object * FIFE::Model::createObject | ( | const std::string & | identifier, |
const std::string & | name_space, | ||
Object * | parent = 0 |
||
) |
Add an object to the metamodel.
identifier | A string for identifying this object; must be unique for its namespace. |
parent | Objects may optionally inherit values from a parent object. |
void FIFE::Model::deleteMap | ( | Map * | map) |
void FIFE::Model::deleteMaps | ( | ) |
bool FIFE::Model::deleteObject | ( | Object * | object) |
bool FIFE::Model::deleteObjects | ( | ) |
CellGrid * FIFE::Model::getCellGrid | ( | const std::string & | gridtype) |
Map * FIFE::Model::getMap | ( | const std::string & | identifier) | const |
uint32_t FIFE::Model::getMapCount | ( | ) | const |
Return the number of maps in this model
Definition at line 131 of file model.cpp.
Referenced by FIFE::Engine::pump().
|
inline |
std::list< std::string > FIFE::Model::getNamespaces | ( | ) | const |
Object * FIFE::Model::getObject | ( | const std::string & | id, |
const std::string & | name_space | ||
) |
std::list< Object * > FIFE::Model::getObjects | ( | const std::string & | name_space) | const |
IPather * FIFE::Model::getPather | ( | const std::string & | pathername) |
|
inline |
Gets model speed.
Definition at line 151 of file model.h.
References FIFE::TimeProvider::getMultiplier().
|
inline |
Sets speed for the model. With speed 1.0, everything runs with normal speed. With speed 2.0, clock is ticking twice as fast. With 0, everything gets paused. Negavtive values are not supported (throws NotSupported exception).
Definition at line 147 of file model.h.
References FIFE::TimeProvider::setMultiplier().
void FIFE::Model::update | ( | ) |
Called periodically to update events on model
Definition at line 271 of file model.cpp.
Referenced by FIFE::Engine::pump().