83 Map*
getMap(
const std::string& identifier)
const;
118 Object*
getObject(
const std::string&
id,
const std::string& name_space);
122 std::list<Object*>
getObjects(
const std::string& name_space)
const;
std::list< std::string > getNamespaces() const
Get a list of namespaces currently referenced by objects in the metamodel.
Abstract interface for all the renderbackends.
Timeprovider is an utility providing time management functionality You can have hierarchy of time pro...
Map * getMap(const std::string &identifier) const
Get a map.
double getTimeMultiplier() const
Gets model speed.
void adoptCellGrid(CellGrid *grid)
Adds cellgrid to model.
std::vector< CellGrid * > m_adopted_grids
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...
const std::list< Map * > & getMaps() const
Get all the maps in the model.
namespace_t * m_last_namespace
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::list< namespace_t > m_namespaces
float getMultiplier() const
void deleteMaps()
Removes all maps from this model.
uint32_t getMapCount() const
Return the number of maps in this model.
A model is a facade for everything in the model.
std::list< Map * > m_maps
CellGrid * getCellGrid(const std::string &gridtype)
Returns new copy of cellgrid corresponding given name.
Model(RenderBackend *renderbackend, const std::vector< RendererBase * > &renderers)
Constructor.
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::vector< CellGrid * > m_created_grids
std::map< std::string, Object * > objectmap_t
std::list< Object * > getObjects(const std::string &name_space) const
Get all the objects in the given namespace.
Map * createMap(const std::string &identifier)
Add a map this model, and get a pointer to it.