|
27 | 27 | // Desc: General Effects Descriptions
|
28 | 28 | ///////////////////////////////////////////////////////////////////////////////////////////////////
|
29 | 29 |
|
| 30 | +// Kris: August 23, 2003 |
| 31 | +// All OCLs return the first object that is created (or NULL if not applicable). |
| 32 | + |
30 | 33 | #pragma once
|
31 | 34 |
|
32 | 35 | #ifndef _ObjectCreationList_H_
|
@@ -81,19 +84,19 @@ class ObjectCreationNugget : public MemoryPoolObject
|
81 | 84 | needed. Note that primary can be null, so you must check for this.
|
82 | 85 | Bool useOwner determines whether we are creating the the master object or not (for deliverpayload)
|
83 | 86 | */
|
84 |
| - virtual void create( const Object* primaryObj, const Coord3D *primary, const Coord3D* secondary, UnsignedInt lifetimeFrames = 0 ) const = 0; |
| 87 | + virtual Object* create( const Object* primaryObj, const Coord3D *primary, const Coord3D* secondary, UnsignedInt lifetimeFrames = 0 ) const = 0; |
85 | 88 |
|
86 | 89 | /**
|
87 | 90 | the object-based version... by default, just call the location-based implementation.
|
88 | 91 | Note that primary can be null, so you must check for this.
|
89 | 92 | */
|
90 |
| - virtual void create( const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
| 93 | + virtual Object* create( const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
91 | 94 |
|
92 | 95 | /**
|
93 | 96 | A variation used by DeliverPayload -- the createOwner Bool specifies whether we are creating the transport
|
94 | 97 | object, or using the existing one.
|
95 | 98 | */
|
96 |
| - virtual void create( const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) const; |
| 99 | + virtual Object* create( const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) const; |
97 | 100 | };
|
98 | 101 | EMPTY_DTOR(ObjectCreationNugget)
|
99 | 102 |
|
@@ -132,30 +135,44 @@ class ObjectCreationList
|
132 | 135 |
|
133 | 136 | void addObjectCreationNugget(ObjectCreationNugget* nugget);
|
134 | 137 |
|
135 |
| - inline static void create( const ObjectCreationList* ocl, const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) |
| 138 | + // Kris: August 23, 2003 |
| 139 | + // All OCLs return the first object that is created (or NULL if not applicable). |
| 140 | + inline static Object* create( const ObjectCreationList* ocl, const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) |
136 | 141 | {
|
137 |
| - if (ocl) ocl->create( primaryObj, primary, secondary, createOwner, lifetimeFrames ); |
| 142 | + if( ocl ) |
| 143 | + return ocl->createInternal( primaryObj, primary, secondary, createOwner, lifetimeFrames ); |
| 144 | + return NULL; |
138 | 145 | }
|
139 | 146 |
|
| 147 | + // Kris: August 23, 2003 |
| 148 | + // All OCLs return the first object that is created (or NULL if not applicable). |
140 | 149 | /// inline convenience method to avoid having to check for null.
|
141 |
| - inline static void create(const ObjectCreationList* ocl, const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, UnsignedInt lifetimeFrames = 0 ) |
| 150 | + inline static Object* create(const ObjectCreationList* ocl, const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, UnsignedInt lifetimeFrames = 0 ) |
142 | 151 | {
|
143 |
| - if (ocl) ocl->create( primaryObj, primary, secondary, lifetimeFrames ); |
| 152 | + if (ocl) |
| 153 | + return ocl->createInternal( primaryObj, primary, secondary, lifetimeFrames ); |
| 154 | + return NULL; |
144 | 155 | }
|
145 | 156 |
|
| 157 | + // Kris: August 23, 2003 |
| 158 | + // All OCLs return the first object that is created (or NULL if not applicable). |
146 | 159 | /// inline convenience method to avoid having to check for null.
|
147 |
| - inline static void create( const ObjectCreationList* ocl, const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) |
| 160 | + inline static Object* create( const ObjectCreationList* ocl, const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) |
148 | 161 | {
|
149 |
| - if (ocl) ocl->create( primary, secondary, lifetimeFrames ); |
| 162 | + if (ocl) |
| 163 | + return ocl->createInternal( primary, secondary, lifetimeFrames ); |
| 164 | + return NULL; |
150 | 165 | }
|
151 | 166 |
|
152 | 167 | protected:
|
153 | 168 |
|
154 | 169 | private:
|
155 | 170 |
|
156 |
| - void create(const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) const; |
157 |
| - void create(const Object* primaryObj, const Coord3D *primary, const Coord3D* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
158 |
| - void create(const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
| 171 | + // Kris: August 23, 2003 |
| 172 | + // All OCLs return the first object that is created (or NULL if not applicable). |
| 173 | + Object* createInternal(const Object* primaryObj, const Coord3D *primary, const Coord3D *secondary, Bool createOwner, UnsignedInt lifetimeFrames = 0 ) const; |
| 174 | + Object* createInternal(const Object* primaryObj, const Coord3D *primary, const Coord3D* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
| 175 | + Object* createInternal(const Object* primary, const Object* secondary, UnsignedInt lifetimeFrames = 0 ) const; |
159 | 176 |
|
160 | 177 | // note, this list doesn't own the nuggets; all nuggets are owned by the Store.
|
161 | 178 | typedef std::vector<ObjectCreationNugget*> ObjectCreationNuggetVector;
|
|
0 commit comments