Changeset 8675 for code/branches/presentation/src/modules/objects/triggers
- Timestamp:
- May 30, 2011, 12:14:57 AM (13 years ago)
- Location:
- code/branches/presentation/src/modules/objects/triggers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/modules/objects/triggers/DistanceMultiTrigger.cc
r8213 r8675 53 53 Default Constructor. Registers the object and initializes default values. 54 54 */ 55 DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator) , beaconMask_(NULL)55 DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator) 56 56 { 57 57 RegisterObject(DistanceMultiTrigger); … … 60 60 this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off); 61 61 this->targetName_ = ""; 62 this->beaconMask_.exclude(Class(BaseObject)); 63 this->beaconMask_.include(Class(DistanceTriggerBeacon)); 62 64 } 63 65 … … 68 70 DistanceMultiTrigger::~DistanceMultiTrigger() 69 71 { 70 if(this->beaconMask_ != NULL) 71 delete this->beaconMask_; 72 72 73 } 73 74 … … 135 136 // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons. 136 137 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify) 137 targetMask = *this->beaconMask_;138 targetMask = this->beaconMask_; 138 139 139 140 // Iterate through all objects that are targets of the DistanceMultiTrigger. … … 207 208 { 208 209 this->beaconMode_ = mode; 209 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify && this->beaconMask_ == NULL)210 {211 this->beaconMask_ = new ClassTreeMask();212 this->beaconMask_->exclude(Class(BaseObject));213 this->beaconMask_->include(Class(DistanceTriggerBeacon));214 }215 210 } 216 211 -
code/branches/presentation/src/modules/objects/triggers/DistanceMultiTrigger.h
r8213 r8675 152 152 distanceMultiTriggerBeaconMode::Value beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in. 153 153 std::string targetName_; //!< The target name, used in <em>single-target</em> mode. 154 ClassTreeMask *beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.154 ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons. 155 155 156 156 std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger. -
code/branches/presentation/src/modules/objects/triggers/DistanceTrigger.cc
r8667 r8675 57 57 The creator of this trigger. 58 58 */ 59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) , beaconMask_(NULL)59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) 60 60 { 61 61 RegisterObject(DistanceTrigger); … … 64 64 this->targetMask_.exclude(Class(BaseObject)); 65 65 this->targetName_ = ""; 66 this->beaconMask_.exclude(Class(BaseObject)); 67 this->beaconMask_.include(Class(DistanceTriggerBeacon)); 66 68 } 67 69 … … 72 74 DistanceTrigger::~DistanceTrigger() 73 75 { 74 // Delete the beacon mask if it exists. 75 if(this->beaconMask_ != NULL) 76 delete this->beaconMask_; 76 77 77 } 78 78 … … 159 159 // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons. 160 160 if(this->beaconMode_ == distanceTriggerBeaconMode::identify) 161 targetMask = *this->beaconMask_;161 targetMask = this->beaconMask_; 162 162 163 163 // Iterate through all objects that are targets of the DistanceTrigger. … … 231 231 { 232 232 this->beaconMode_ = mode; 233 if(this->beaconMode_ == distanceTriggerBeaconMode::identify && this->beaconMask_ == NULL)234 {235 this->beaconMask_ = new ClassTreeMask();236 this->beaconMask_->exclude(Class(BaseObject));237 this->beaconMask_->include(Class(DistanceTriggerBeacon));238 }239 233 } 240 234 -
code/branches/presentation/src/modules/objects/triggers/DistanceTrigger.h
r8637 r8675 162 162 distanceTriggerBeaconMode::Value beaconMode_; //!< The beacon mode. 163 163 std::string targetName_; //!< The name a DistanceTriggerBeacon needs to have to make the DistanceTrigger react to it if in beacon-mode. 164 ClassTreeMask *beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.164 ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons. 165 165 166 166 WeakPtr<WorldEntity> cache_; //!< Caches the entity that triggered the DistanceTrigger last.
Note: See TracChangeset
for help on using the changeset viewer.