Changeset 5929 for code/trunk/src/orxonox/pickup
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/pickup/DroppedItem.cc
r5781 r5929 56 56 if (this->item_) 57 57 { 58 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)58 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 59 59 { 60 60 Vector3 distance = it->getWorldPosition() - this->getWorldPosition(); … … 69 69 { 70 70 COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl; 71 delete this;71 this->destroy(); 72 72 } 73 73 } … … 76 76 if (this->timeToLive_ > 0) 77 77 { 78 ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback)); 79 this->timer_.setTimer(this->timeToLive_, false, this, exec, false); 78 this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false); 80 79 } 81 80 } … … 85 84 { 86 85 COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl; 87 delete this->item_;86 this->item_->destroy(); 88 87 } 89 88 90 delete this;89 this->destroy(); 91 90 } 92 91 -
code/trunk/src/orxonox/pickup/DroppedItem.h
r5781 r5929 77 77 BaseItem* item_; 78 78 79 Timer <DroppedItem>timer_;79 Timer timer_; 80 80 }; 81 81 } -
code/trunk/src/orxonox/pickup/ModifierPickup.cc
r5781 r5929 101 101 if (this->duration_ > 0.0f) 102 102 { 103 Executor Member<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));103 Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this)); 104 104 executor->setDefaultValues(pawn); 105 this->timer_.setTimer(this->duration_, false, this,executor);105 this->timer_.setTimer(this->duration_, false, executor); 106 106 } 107 107 … … 139 139 this->timer_.stopTimer(); 140 140 141 delete this;141 this->destroy(); 142 142 143 143 return true; -
code/trunk/src/orxonox/pickup/ModifierPickup.h
r5781 r5929 129 129 130 130 void timerCallback(Pawn* pawn); //!< Method called when the timer runs out. 131 131 132 private: 132 133 float getAdditiveModifier(ModifierType::Value type) const; //!< Get the additive modifier for a given ModifierType. … … 138 139 std::map<ModifierType::Value, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType. 139 140 140 float duration_; //!< Duration of this pickup's effect (0 for unlimited).141 Timer <ModifierPickup> timer_;//!< Timer used if the pickup's effect has a time limit.141 float duration_; //!< Duration of this pickup's effect (0 for unlimited). 142 Timer timer_; //!< Timer used if the pickup's effect has a time limit. 142 143 }; 143 144 } -
code/trunk/src/orxonox/pickup/PickupSpawner.cc
r5781 r5929 91 91 asItem->addTemplate(this->itemTemplate_); 92 92 PickupInventory::getImageForItem(asItem); 93 delete newObject;93 newObject->destroy(); 94 94 } 95 95 … … 127 127 if (this->isActive()) 128 128 { 129 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)129 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) 130 130 { 131 131 Vector3 distance = it->getWorldPosition() - this->getWorldPosition(); … … 166 166 if (this->respawnTime_ > 0.0f) 167 167 { 168 ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback)); 169 this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor); 168 this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this))); 170 169 171 170 this->setActive(false); … … 174 173 } 175 174 else 176 delete newObject;175 newObject->destroy(); 177 176 } 178 177 } -
code/trunk/src/orxonox/pickup/PickupSpawner.h
r5781 r5929 114 114 115 115 float respawnTime_; //!< Time after which this gets re-actived. 116 Timer <PickupSpawner> respawnTimer_;//!< Timer used for re-activating.116 Timer respawnTimer_; //!< Timer used for re-activating. 117 117 }; 118 118 } -
code/trunk/src/orxonox/pickup/items/HealthImmediate.cc
r5781 r5929 67 67 { 68 68 pawn->addHealth(this->recoveredHealth_); 69 delete this;69 this->destroy(); 70 70 } 71 71 -
code/trunk/src/orxonox/pickup/items/HealthUsable.cc
r5781 r5929 82 82 83 83 this->removeFrom(pawn); 84 delete this;84 this->destroy(); 85 85 } 86 86 } -
code/trunk/src/orxonox/pickup/items/Jump.cc
r5781 r5929 84 84 { 85 85 this->removeFrom(pawn); 86 delete this;86 this->destroy(); 87 87 } 88 88 }
Note: See TracChangeset
for help on using the changeset viewer.