This class represents a world for objects to interact within. More...
#include <world.h>
Public Types | |
typedef ManagerFactoryMap::const_iterator | ConstManagerFactoryIterator |
Const Iterator type for manager factories stored by this class. | |
typedef WorldManagerContainer::const_iterator | ConstWorldManagerIterator |
Const Iterator type for WorldManager instances stored by this class. | |
typedef ManagerFactoryMap::iterator | ManagerFactoryIterator |
Iterator type for manager factories stored by this class. | |
typedef std::map< String, WorldManagerFactory * > | ManagerFactoryMap |
Basic container type for factories that construct known manager types. | |
typedef std::vector< WorldManager * > | WorldManagerContainer |
Basic container type for WorldManager storage by this class. | |
typedef WorldManagerContainer::iterator | WorldManagerIterator |
Iterator type for WorldManager instances stored by this class. | |
Public Member Functions | |
World (const String &WorldName) | |
Class constructor. More... | |
World (const String &WorldName, const WorldManagerContainer &Managers) | |
Pre-made manager constructor. More... | |
World (const String &WorldName, const Physics::ManagerConstructionInfo &PhysicsInfo, const String &SceneType) | |
Descriptive constructor. More... | |
World (const String &WorldName, const WorldManagerContainer &Managers, const Physics::ManagerConstructionInfo &PhysicsInfo, const String &SceneType) | |
Descriptive pre-made manager constructor. More... | |
World (const XML::Node &SelfNode) | |
XML constructor. More... | |
virtual | ~World () |
class destructor. | |
Boole | AddManager (WorldManager *ManagerToAdd) |
This adds a manager, in the correct order, to the list that the world calls on. More... | |
void | Clear () |
Clears the world of all objects. More... | |
WorldManager * | CreateManager (const String &ManagerImplName, const NameValuePairList &Params, Boole AddToWorld=true) |
Creates a new manager. More... | |
WorldManager * | CreateManager (const String &ManagerImplName, const XML::Node &XMLNode, Boole AddToWorld=true) |
Creates a new manager. More... | |
void | Deinitialize () |
Deinitializes all managers in this world and unhooks all of it's systems, disabling this world. | |
void | DestroyAllManagers () |
Destroys all managers currently in the World. More... | |
void | DestroyManager (WorldManager *ToBeDestroyed) |
Destroys a manager. More... | |
virtual String | GetDerivedSerializableName () const |
Gets the most derived serializable name of this World. More... | |
WorldManager * | GetManager (const Whole ManagerToGet) |
This is will find the manager of a given type. More... | |
const String & | GetName () const |
Gets the name of this world. More... | |
WorldManagerContainer & | GetWorldManagers () |
This gets the list of managers in the world. More... | |
void | Initialize () |
Initializes all managers in this world and performs all the necessary hooks to enable this world. | |
void | PauseWorld (const Boole Pause) |
Pauses all animations, particles, and object movement throughout the world. More... | |
void | PreMainLoopInit () |
Initialize any default managers and any added after construction. This should be called before the Entresol enters it's main loop. | |
virtual void | ProtoDeSerialize (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite this object with it. More... | |
virtual void | ProtoDeSerializeProperties (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite the properties of this object with it. More... | |
virtual void | ProtoSerialize (XML::Node &ParentNode) const |
Convert this class to an XML::Node ready for serialization. More... | |
virtual void | ProtoSerializeProperties (XML::Node &SelfRoot) const |
Convert the properties of this class to an XML::Node ready for serialization. More... | |
void | RemoveAllManagers () |
This removes all managers from the manager list. | |
void | RemoveManager (WorldManager *ToBeRemoved) |
This removes a manager by finding the matching pointer. More... | |
void | RemoveManager (const Whole ToBeRemoved) |
This removes a manager of a specific type from the list. More... | |
Static Public Member Functions | |
static void | AddAllEngineDefaultManagerFactories () |
Adds all the default manager factories provided by the engine. | |
static void | AddManagerFactory (WorldManagerFactory *ToBeAdded) |
Adds/registers a manager factory for use with World instances. More... | |
static void | DestroyAllManagerFactories () |
Destroys all registered manager factories. More... | |
static void | DestroyManagerFactory (WorldManagerFactory *ToBeRemoved) |
Removes and destroys a manager factory in the container of registered factories. More... | |
static void | DestroyManagerFactory (const String &ImplName) |
Removes and destroys a manager factory in the container of registered factories. More... | |
static String | GetSerializableName () |
Get the name of the the XML tag the World class will leave behind as its instances are serialized. More... | |
static void | RemoveManagerFactory (WorldManagerFactory *ToBeRemoved) |
Removes a manager factory from the container of registered factories. More... | |
static void | RemoveManagerFactory (const String &ImplName) |
Removes a manager factory from the container of registered factories. More... | |
Protected Member Functions | |
void | Construct (const Physics::ManagerConstructionInfo &PhysicsInfo, const String &SceneType, const WorldManagerContainer &ManagerToBeAdded) |
Helper function used to assist construction. More... | |
Boole | VerifyManagerInitializations () |
Checks if all managers currently stored in this World have been initialized. More... | |
Protected Attributes | |
String | Name |
Unique string identifier for world. More... | |
WorldManagerContainer | WorldManagers |
A container storing all the managers belonging to this world. More... | |
Static Protected Attributes | |
static ManagerFactoryMap | ManagerFactories |
A global container for registered factories for WorldManagers. More... | |
This class represents a world for objects to interact within.
Objects can be inserted and removed from worlds in order to simulate them. Multiple worlds can exist but objects can only belong to one world at a time.
Mezzanine::World::World | ( | const String & | WorldName | ) |
Mezzanine::World::World | ( | const String & | WorldName, |
const WorldManagerContainer & | Managers | ||
) |
Mezzanine::World::World | ( | const String & | WorldName, |
const Physics::ManagerConstructionInfo & | PhysicsInfo, | ||
const String & | SceneType | ||
) |
Mezzanine::World::World | ( | const String & | WorldName, |
const WorldManagerContainer & | Managers, | ||
const Physics::ManagerConstructionInfo & | PhysicsInfo, | ||
const String & | SceneType | ||
) |
Descriptive pre-made manager constructor.
WorldName | String name of the world. |
Managers | A container of pre-made managers to be used by this world. |
PhysicsInfo | A ManagerConstructionInfo struct with data on how to configure the physics for this world. |
SceneType | A string containing the name of the underlying scene type for this world. |
Mezzanine::World::World | ( | const XML::Node & | SelfNode | ) |
Boole Mezzanine::World::AddManager | ( | WorldManager * | ManagerToAdd | ) |
|
static |
void Mezzanine::World::Clear | ( | ) |
Clears the world of all objects.
|
protected |
WorldManager * Mezzanine::World::CreateManager | ( | const String & | ManagerImplName, |
const NameValuePairList & | Params, | ||
Boole | AddToWorld = true |
||
) |
Creates a new manager.
ManagerImplName | The name of the manager implementation to create. |
Params | A list of name-value pairs for the params that are to be used when creating the manager. |
AddToWorld | Whether or not to add the created manager to the World after creation. |
WorldManager * Mezzanine::World::CreateManager | ( | const String & | ManagerImplName, |
const XML::Node & | XMLNode, | ||
Boole | AddToWorld = true |
||
) |
Creates a new manager.
ManagerImplName | The name of the manager implementation to create. |
XMLNode | An XML node containing all construction and initialization info for the manager to be created. |
AddToWorld | Whether or not to add the created manager to the World after creation. |
|
static |
void Mezzanine::World::DestroyAllManagers | ( | ) |
void Mezzanine::World::DestroyManager | ( | WorldManager * | ToBeDestroyed | ) |
|
static |
|
static |
|
virtual |
WorldManager * Mezzanine::World::GetManager | ( | const Whole | ManagerToGet | ) |
This is will find the manager of a given type.
ManagerToGet | The type ID of the manager to get. Use ManagerBase::ManagerType enum values for this. |
const String & Mezzanine::World::GetName | ( | ) | const |
|
static |
World::WorldManagerContainer & Mezzanine::World::GetWorldManagers | ( | ) |
void Mezzanine::World::PauseWorld | ( | const Boole | Pause | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
void Mezzanine::World::RemoveManager | ( | WorldManager * | ToBeRemoved | ) |
void Mezzanine::World::RemoveManager | ( | const Whole | ToBeRemoved | ) |
This removes a manager of a specific type from the list.
ToBeRemoved | The type ID of the manager to get. Use ManagerBase::ManagerType enum values for this. |
|
static |
|
static |
|
protected |
|
staticprotected |
|
protected |
|
protected |