40 #ifndef _areaeffectmanager_cpp
41 #define _areaeffectmanager_cpp
43 #include "areaeffectmanager.h"
45 #include "fieldofforce.h"
46 #include "gravityfield.h"
47 #include "gravitywell.h"
49 #include "Physics/physicsmanager.h"
51 #include "actormanager.h"
70 TargetManager(Target) { }
95 AreaEffectUpdateWork(NULL),
107 AreaEffectUpdateWork(NULL),
108 ThreadResources(NULL)
296 if(Name == (*it)->GetName())
314 (*AEFactIt).second->DestroyAreaEffect( (*AEIt) );
330 (*AEFactIt).second->DestroyAreaEffect( (*AEIt) );
345 (*AEFactIt).second->DestroyAreaEffect( (*AEIt) );
394 delete AEFactIt->second;
402 {
delete (*AEFactIt).second; }
419 (*AE)->ApplyEffect();
491 {
delete ToBeDestroyed; }
virtual void AddDependency(iWorkUnit *NewDependency)
Force this WorkUnit to Start after another has completed.
This is the base class for all collision shapes.
virtual void DestroyAllAreaEffects()
Destroys all actors currently within this manager.
WorldManager * GetManager(const Whole ManagerToGet)
This is will find the manager of a given type.
virtual void AddToWorld()
Adds the object to the World.
AreaEffectContainer::iterator AreaEffectIterator
Iterator type for AreaEffect instances stored by this class.
WorldTriggerUpdateWorkUnit * GetWorldTriggerUpdateWork()
Gets a pointer to the work unit that updates all WorldTriggers.
bool Boole
Generally acts a single bit, true or false.
virtual void Pause(const UInt32 PL)
Sets the pause state of this manager, or has no effect depending on the value passed in...
A factory type for the creation of GravityWell objects.
virtual void AddWorkUnitMain(iWorkUnit *MoreWork, const String &WorkUnitName)
Add a normal Mezzanine::Threading::iWorkUnit to this For fcheduling.
A manager responsible for the storage and management of all areaeffects in use.
void DestroyManager(WorldManager *ToBeDestroyed)
Destroys a Manager created by this factory.
AreaEffectIterator EndAreaEffect()
Gets an iterator to one passed the last AreaEffect in this manager.
ManagerType
A listing of Manager Types.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
A factory type for the creation of GravityField objects.
virtual void AddAreaEffectFactory(AreaEffectFactory *ToBeAdded)
Adds/registers a AreaEffect factory with this manager, allowing it to be constructed through this API...
virtual void RemoveWorkUnitMain(iWorkUnit *LessWork)
Remove a WorkUnit from the main pool of WorkUnits (and not from the groups of Affinity or MonpolyWork...
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
virtual void DestroyAreaEffect(const Whole Index)
Destroys an areaeffect at the specified index.
This is a gravity well implementation of the AreaEffect class.
AreaEffectUpdateWorkUnit & operator=(const AreaEffectUpdateWorkUnit &Other)
Protected assignment operator. THIS IS NOT ALLOWED.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
Threading::FrameScheduler & GetScheduler()
Gets the core structure responsible for scheduling work in the Entresol main loop.
AreaEffectUpdateWorkUnit * GetAreaEffectUpdateWork()
Gets the work unit responsible for updating area effects stored by this manager.
virtual ~AreaEffectManager()
Class destructor.
virtual void DestroyAreaEffectFactory(AreaEffectFactory *ToBeDestroyed)
Removes and destroys a AreaEffect factory in this manager.
AreaEffectUpdateWorkUnit(const AreaEffectUpdateWorkUnit &Other)
Protected copy constructor. THIS IS NOT ALLOWED.
This is a Mezzanine::Threading::iWorkUnit for the updating of AreaEffects.
This is an implementation of the AreaEffect class that alters gravity in a region.
A thread specific collection of double-buffered and algorithm specific resources. ...
This class is used to define area's in the world that have unique effects.
This is field that applies force in a direction, and doesn't tamper with gravity. ...
AreaEffectIterator BeginAreaEffect()
Gets an iterator to the first AreaEffect in this manager.
A light-weight handle for manipulating nodes in DOM tree.
virtual Whole GetNumAreaEffects() const
Gets the number of actors stored in this manager.
uint32_t UInt32
An 32-bit unsigned integer.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
Entresol * TheEntresol
The actual pointer to the Entresol core class.
A base factory type for the creation of AreaEffect objects.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
virtual String GetTypeName() const =0
Gets the name of the AreaEffect that is created by this factory.
virtual void DestroyAllAreaEffectFactories()
Destroys all AreaEffect factories in this manager.
GravityWell * CreateGravityWell(const String &Name, const Boole AddToWorld=true)
Creates a new GravityWell.
virtual AreaEffect * GetAreaEffect(const Whole Index) const
Gets an AreaEffect by Index.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Thrown when the available information should have worked but failed for unknown reasons.
FactoryMap::iterator FactoryIterator
Iterator type for AreaEffectFactory instances stored by this class.
This is the base class for all managers that belong to a single world instance.
virtual void ClearDependencies()
Drop any information about what work units this one depends on.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
This is simply a place for storing all the Physics Related functions.
virtual ~AreaEffectUpdateWorkUnit()
Class destructor.
Threading::DefaultWorkUnit * GetSimulationWork()
Gets a pointer to the work unit that steps the simulation.
AreaEffectManager(World *Creator)
Class constructor.
World * ParentWorld
A pointer to the world that created this manager.
FieldOfForce * CreateFieldOfForce(const String &Name, const Boole AddToWorld=true)
Creates a new FieldOfForce.
FactoryMap AreaEffectFactories
A map containing all registered AreaEffect type factories.
WorldManager * CreateManager(World *Creator, const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
virtual ~DefaultAreaEffectManagerFactory()
Class destructor.
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
The bulk of the engine components go in this namspace.
AreaEffect * CreateAreaEffect(const String &TypeName, const String &InstanceName, const NameValuePairMap &Params, const Boole AddToWorld=true)
Creates a new AreaEffect.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
AreaEffectUpdateWorkUnit * AreaEffectUpdateWork
The work unit that updates all the actors stored by this manager.
This class represents a world for objects to interact within.
ActorUpdateWorkUnit * GetActorUpdateWork()
Gets the work unit responsible for updating actors stored by this manager.
AreaEffectManager * TargetManager
A pointer to the manager this work unit is processing.
virtual void MainLoopInitialize()
Does all of the necessary configuration to prepare for the start of the main loop.
DefaultAreaEffectManagerFactory()
Class constructor.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
static const String ImplementationName
A String containing the name of this manager implementation.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
std::string String
A datatype used to a series of characters.
virtual void DoWork(Threading::DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
This does any required update of the Graphical Scene graph and REnders one frame. ...
GravityField * CreateGravityField(const String &Name, const Boole AddToWorld=true)
Creates a new GravityField.
virtual void RemoveAreaEffectFactory(AreaEffectFactory *ToBeRemoved)
Removes a AreaEffect factory from this manager.
A manager responsible for the storage and management of all actors that exist in a world...
AreaEffectContainer AreaEffects
Container storing all AreaEffects belonging to this manager.
virtual ManagerType GetInterfaceType() const
This returns the type of this manager.
A factory type for the creation of FieldOfForce objects.
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.
AreaEffectContainer::const_iterator ConstAreaEffectIterator
Const Iterator type for AreaEffect instances stored by this class.