#include <ObjectCreationList.h>
Inherits MemoryPoolObject.
Inherited by ApplyRandomForceNugget, AttackNugget, DeliverPayloadNugget, FireWeaponNugget, and GenericObjectCreationNugget.
Public Member Functions | |
| ObjectCreationNugget () | |
| virtual Object * | create (const Object *primaryObj, const Coord3D *primary, const Coord3D *secondary, Real angle, UnsignedInt lifetimeFrames=0) const =0 |
| virtual Object * | create (const Object *primary, const Object *secondary, UnsignedInt lifetimeFrames=0) const |
| virtual Object * | create (const Object *primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames=0) const |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Additional Inherited Members | |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
An ObjectCreationNugget encapsulates the creation of an Object. ObjectCreationNuggets are virtually never used on their own, but rather, as a component of an ObjectCreationList (see below).
Important notes:
– ObjectCreationNugget is an ABC; all the implementations are (currently) located in ObjectCreationList.cpp, thought they will probably be spread out more as we add more implementations.
– As part of an ObjectCreationList, an ObjectCreationNugget is shared between multiple units. The implication is that an ObjectCreationNugget should not require private data storage to do what it needs to do, aside from stuff initialized at ObjectCreationNugget instantiation time (eg, parameters from an INI file). To help enforce this, all it's methods are declared 'const'. If you can't implement what you need within this framework, please don't simply de-const things, because it could lead to very strange side-effects. Instead, the system will have to be enhanced to allow for multiple instances of each ObjectCreationNugget.
– an individual ObjectCreationNugget is generally not directly accessible to anyone outside of the ObjectCreationList system; in fact, it could probably be a private class, but isn't, mainly for coding convenience.
– Unlike most other game systems, ObjectCreationNuggets can't be overridden by subsequent INI file loads. This isn't really a problem, because all you really need to do to "override" one is to specify a different one.
Definition at line 73 of file ObjectCreationList.h.
|
inline |
Definition at line 79 of file ObjectCreationList.h.
|
virtual |
the object-based version... by default, just call the location-based implementation. Note that primary can be null, so you must check for this.
Reimplemented in ApplyRandomForceNugget, and GenericObjectCreationNugget.
Definition at line 109 of file ObjectCreationList.cpp.
|
virtual |
A variation used by DeliverPayload – the createOwner Bool specifies whether we are creating the transport object, or using the existing one.
Reimplemented in DeliverPayloadNugget.
Definition at line 122 of file ObjectCreationList.cpp.
|
pure virtual |
The main guts of the system: actually perform the sound and/or video effects needed. Note that primary can be null, so you must check for this. Bool useOwner determines whether we are creating the the master object or not (for deliverpayload)
Implemented in ApplyRandomForceNugget, AttackNugget, DeliverPayloadNugget, FireWeaponNugget, and GenericObjectCreationNugget.