41 #ifndef terrainmanager_cpp
42 #define terrainmanager_cpp
46 #include "terrainmanager.h"
47 #include "meshterrain.h"
77 for( std::vector<TerrainBase*>::iterator it =
Terrains.begin(); it !=
Terrains.end(); ++it )
79 if( Name == (*it)->GetName() )
98 std::vector<TerrainBase*>::iterator it =
Terrains.begin() + Index;
99 (*it)->RemoveFromWorld();
105 for( std::vector<TerrainBase*>::iterator it =
Terrains.begin() ; it !=
Terrains.end() ; ++it )
107 if(ToBeRemoved == (*it))
109 (*it)->RemoveFromWorld();
121 for( std::vector<TerrainBase*>::iterator it =
Terrains.begin() ; it !=
Terrains.end() ; ++it )
122 (*it)->RemoveFromWorld();
128 std::vector<TerrainBase*>::iterator it =
Terrains.begin() + Index;
129 (*it)->RemoveFromWorld();
136 for( std::vector<TerrainBase*>::iterator it =
Terrains.begin() ; it !=
Terrains.end() ; ++it )
138 if(ToBeDestroyed == (*it))
140 (*it)->RemoveFromWorld();
152 for( std::vector<TerrainBase*>::iterator it =
Terrains.begin() ; it !=
Terrains.end() ; ++it )
154 (*it)->RemoveFromWorld();
229 {
delete ToBeDestroyed; }
TerrainContainer Terrains
A container of all terrain instances.
virtual Whole GetNumTerrains() const
Gets the number of terrains being stored in this manager.
virtual ~TerrainManager()
Class destructor.
virtual void RemoveTerrain(const Whole &Index)
Removes a terrain from the world and this manager by index.
virtual void AddToWorld()=0
Adds the object to the World.
void DestroyManager(WorldManager *ToBeDestroyed)
Destroys a Manager created by this factory.
ManagerType
A listing of Manager Types.
WorldManager * CreateManager(World *Creator, const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
static const String ImplementationName
A String containing the name of this manager implementation.
virtual void AddTerrain(TerrainBase *Terrain)
Adds a pre-made terrain to the world and the manager.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
virtual void DestroyTerrain(const Whole &Index)
Destroys a terrain and removes it from world.
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
virtual ManagerType GetInterfaceType() const
This returns the type of this manager.
virtual void RemoveAllTerrains()
Removes all terrains currently in this manager from the world and the manager.
virtual void Pause(const UInt32 PL)
Sets the pause state of this manager, or has no effect depending on the value passed in...
virtual void DestroyAllTerrains()
Removes and deletes all terrains currently in this manager from the world and the manager...
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
virtual MeshTerrain * CreateMeshTerrain(const Vector3 &InitPosition, const String &name, const String &file, const String &group)
Creates a terrain based on a given mesh.
A light-weight handle for manipulating nodes in DOM tree.
This is manager for terrains and their functions.
This is the base class from which all the terrains inherit.
uint32_t UInt32
An 32-bit unsigned integer.
virtual TerrainBase * GetTerrainByIndex(const Whole &Index)
Retrieves a MeshTerrain from the list of terrains.
TerrainManager(World *Creator)
Class constructor.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
This is the base class for all managers that belong to a single world instance.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
DefaultTerrainManagerFactory()
Class constructor.
This is used to represent a point in space, or a vector through space.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
This class represents a world for objects to interact within.
virtual TerrainBase * GetTerrainByName(const String &Name)
Retrieves a Meshterrain from the list of terrains.
std::string String
A datatype used to a series of characters.
virtual ~DefaultTerrainManagerFactory()
Class destructor.
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.