- Timestamp:
- Dec 26, 2009, 10:06:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
r6419 r6421 53 53 /** 54 54 @brief 55 Constructor. Registers thePickupSpawner.55 Constructor. Creates a blank PickupSpawner. 56 56 @param creator 57 57 Pointer to the object which created this item. … … 62 62 } 63 63 64 /** 65 @brief 66 Constructor, Creates a fully functional PickupSpawner. 67 @param creator 68 The creator of this PickupSpawner. 69 @param pickup 70 The Pickupable to be spawned by this PickupSpawner. 71 @param triggerDistance 72 The distance at which the PickupSpawner will trigger. 73 @param respawnTime 74 The minimum time between two spawns. 75 @param maySpawnedItems 76 The maximum number of items spawned by this PickupSpawner. 77 */ 64 78 PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator) 65 79 { … … 73 87 } 74 88 89 /** 90 @brief 91 Registers the object and sets some default values. 92 */ 75 93 void PickupSpawner::initialize(void) 76 94 { … … 92 110 PickupSpawner::~PickupSpawner() 93 111 { 94 112 if(this->pickup_ != NULL) 113 delete this->pickup_; 95 114 } 96 115 … … 107 126 SUPER(PickupSpawner, XMLPort, xmlelement, mode); 108 127 109 XMLPortObject(PickupSpawner, Pickupable, "pickup", addPickupable, getPickupable, xmlelement, mode);128 XMLPortObject(PickupSpawner, Pickupable, "pickup", setPickupable, getPickupable, xmlelement, mode); 110 129 111 130 XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode); … … 128 147 // & load the GUI itself too, along with some empty windows 129 148 // = even less delays 130 // GUIManager:: showGUI("PickupInventory");131 // GUIManager:: hideGUI("PickupInventory");149 // GUIManager::getInstance().showGUI("PickupInventory"); 150 // GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")"); 132 151 // PickupInventory::getSingleton(); 133 152 } 134 153 135 void PickupSpawner::addPickupable(Pickupable* pickup) 154 /** 155 @brief 156 Sets a Pickupable for the PickupSpawner to spawn. 157 @param pickup 158 The Pickupable to be set. 159 */ 160 void PickupSpawner::setPickupable(Pickupable* pickup) 136 161 { 137 162 if(this->pickup_ != NULL) … … 149 174 } 150 175 151 Pickupable* PickupSpawner::getPickupable(void) 176 /** 177 @brief 178 Get the Pickupable that is spawned by this PickupSpawner. 179 @return 180 Returns the Pickupable that is spawned by this PickupSpawner. 181 */ 182 const Pickupable* PickupSpawner::getPickupable(void) 152 183 { 153 184 return this->pickup_; … … 166 197 // } 167 198 199 /** 200 @brief 201 Sets the maximum number of spawned items. 202 @param items 203 The maximum number of spawned items to be set. 204 */ 168 205 void PickupSpawner::setMaxSpawnedItems(int items) 169 206 { … … 243 280 } 244 281 282 /** 283 @brief 284 Decrements the number of remaining spawns. 285 Sets the PickupSpawner to inactive for the duration of the respawnTime. 286 Destroys the PickupSpawner if the number of remaining spawns has reached zero. 287 288 */ 245 289 void PickupSpawner::decrementSpawnsRemaining(void) 246 290 { … … 251 295 if(this->spawnsRemaining_ != 0 && this->respawnTime_ > 0) 252 296 { 253 //TODO: Nicer? 297 //TODO: Nicer? Does this even work? 254 298 this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this))); 255 299
Note: See TracChangeset
for help on using the changeset viewer.