47 class ModelMapObserver;
84 Map*
getMap(
const std::string& identifier)
const;
123 Object*
getObject(
const std::string&
id,
const std::string& name_space);
127 std::list<Object*>
getObjects(
const std::string& name_space)
const;
180 const namespace_t*
selectNamespace(
const std::string& name_space)
const;
Abstract interface for all the renderbackends.
Timeprovider is an utility providing time management functionality You can have hierarchy of time pro...
uint32_t getMapCount() const
Return the number of maps in this model.
void adoptCellGrid(CellGrid *grid)
Adds cellgrid to model.
void setMultiplier(float multiplier)
With multiplier, you can adjust the time speed.
RenderBackend * m_renderbackend
bool deleteObjects()
Attempt to remove all objects from the model Fails and returns false if any maps with instances are p...
uint32_t getActiveCameraCount() const
Return the number of enabled cameras in this model.
std::list< Object * > getObjects(const std::string &name_space) const
Get all the objects in the given namespace.
namespace_t * m_lastNamespace
Used to remember last 'selected' namespace.
std::vector< IPather * > m_pathers
Object * createObject(const std::string &identifier, const std::string &name_space, Object *parent=0)
Add an object to the metamodel.
Base class for all fife classes Used e.g.
void update()
Called periodically to update events on model.
std::vector< RendererBase * > m_renderers
void setTimeMultiplier(float multip)
Sets speed for the model.
std::vector< CellGrid * > m_createdGrids
std::vector< CellGrid * > m_adoptedGrids
std::list< namespace_t > m_namespaces
void deleteMaps()
Removes all maps from this model.
const std::list< Map * > & getMaps() const
Get all the maps in the model.
void removeCellGrid(CellGrid *grid)
Removes cellgrid from model.
A model is a facade for everything in the model.
double getTimeMultiplier() const
Gets model speed.
ModelMapObserver * m_mapObserver
std::list< std::string > getNamespaces() const
Get a list of namespaces currently referenced by objects in the metamodel.
Model(RenderBackend *renderbackend, const std::vector< RendererBase *> &renderers)
Constructor.
std::list< Map * > m_maps
CellGrid * getCellGrid(const std::string &gridtype)
Returns new copy of cellgrid corresponding given name.
float getMultiplier() const
namespace_t * selectNamespace(const std::string &name_space)
Convenience function to retrieve a pointer to a namespace or NULL if it doesn't exist.
TimeProvider m_timeprovider
void deleteMap(Map *)
Remove a map from this model.
IPather * getPather(const std::string &pathername)
Returns pather corresponding given name.
void adoptPather(IPather *pather)
Adds pather to model.
std::pair< std::string, objectmap_t > namespace_t
Object * getObject(const std::string &id, const std::string &name_space)
Get an object by its id.
bool deleteObject(Object *)
Attempt to remove an object from the model Fails and returns false if the object is referenced by an ...
std::map< std::string, Object * > objectmap_t
Map * getMap(const std::string &identifier) const
Get a map.
Map * createMap(const std::string &identifier)
Add a map this model, and get a pointer to it.