FIFE
2008.0
|
#include <model.h>
Public Member Functions | |
Model (RenderBackend *renderbackend, const std::vector< RendererBase * > &renderers, ImagePool *imagepool, AnimationPool *animpool) | |
~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 | getNumMaps () 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 (AbstractPather *pather) |
AbstractPather * | 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 () |
virtual void | addRef () |
virtual void | decRef () |
virtual unsigned int | getRefCount () |
![]() | |
virtual void | addRef ()=0 |
virtual void | decRef ()=0 |
virtual unsigned int | getRefCount ()=0 |
FIFE::Model::Model | ( | RenderBackend * | renderbackend, |
const std::vector< RendererBase * > & | renderers, | ||
ImagePool * | imagepool, | ||
AnimationPool * | animpool | ||
) |
void FIFE::Model::adoptCellGrid | ( | CellGrid * | grid | ) |
Adds cellgrid to model. Moves ownership to model
Definition at line 94 of file model.cpp.
Referenced by FIFE::Engine::init().
void FIFE::Model::adoptPather | ( | AbstractPather * | pather | ) |
Adds pather to model. Moves ownership to model
Definition at line 80 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 |
|
inline |
std::list< std::string > FIFE::Model::getNamespaces | ( | ) | const |
uint32_t FIFE::Model::getNumMaps | ( | ) | const |
Return the number of maps in this model
Definition at line 132 of file model.cpp.
Referenced by FIFE::Engine::pump().
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 |
AbstractPather * FIFE::Model::getPather | ( | const std::string & | pathername | ) |
|
inline |
Gets model speed.
Definition at line 154 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 150 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().