Changeset 3280 for code/trunk/src/orxonox/objects/worldentities/triggers
- Timestamp:
- Jul 12, 2009, 11:58:01 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 (added) merged: 3235-3237,3245-3250,3253-3254,3260-3261,3265,3270
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r3196 r3280 141 141 } 142 142 143 bool DistanceTrigger::isTriggered(TriggerMode mode)143 bool DistanceTrigger::isTriggered(TriggerMode::Value mode) 144 144 { 145 145 if (Trigger::isTriggered(mode)) -
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r3196 r3280 59 59 60 60 protected: 61 virtual bool isTriggered(TriggerMode mode);61 virtual bool isTriggered(TriggerMode::Value mode); 62 62 virtual void notifyMaskUpdate() {} 63 63 -
code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
r3196 r3280 54 54 } 55 55 56 bool EventTrigger::isTriggered(TriggerMode mode)56 bool EventTrigger::isTriggered(TriggerMode::Value mode) 57 57 { 58 58 if (Trigger::isTriggered(mode)) -
code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.h
r3196 r3280 47 47 48 48 protected: 49 virtual bool isTriggered(TriggerMode mode);49 virtual bool isTriggered(TriggerMode::Value mode); 50 50 51 51 private: -
code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r3196 r3280 70 70 71 71 protected: 72 virtual bool isTriggered(TriggerMode mode) = 0;72 virtual bool isTriggered(TriggerMode::Value mode) = 0; 73 73 74 74 /** -
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc
r3196 r3280 46 46 RegisterObject(Trigger); 47 47 48 this->mode_ = T M_EventTriggerAND;48 this->mode_ = TriggerMode::EventTriggerAND; 49 49 50 50 this->bFirstTick_ = true; … … 163 163 } 164 164 165 bool Trigger::isTriggered(TriggerMode mode)165 bool Trigger::isTriggered(TriggerMode::Value mode) 166 166 { 167 167 // if (this->bUpdating_) … … 175 175 switch (mode) 176 176 { 177 case T M_EventTriggerAND:177 case TriggerMode::EventTriggerAND: 178 178 returnval = checkAnd(); 179 179 break; 180 case T M_EventTriggerOR:180 case TriggerMode::EventTriggerOR: 181 181 returnval = checkOr(); 182 182 break; 183 case T M_EventTriggerXOR:183 case TriggerMode::EventTriggerXOR: 184 184 returnval = checkXor(); 185 185 break; … … 270 270 { 271 271 if (modeName == "and") 272 this->setMode(T M_EventTriggerAND);272 this->setMode(TriggerMode::EventTriggerAND); 273 273 else if (modeName == "or") 274 this->setMode(T M_EventTriggerOR);274 this->setMode(TriggerMode::EventTriggerOR); 275 275 else if (modeName == "xor") 276 this->setMode(T M_EventTriggerXOR);276 this->setMode(TriggerMode::EventTriggerXOR); 277 277 } 278 278 279 279 std::string Trigger::getModeString() const 280 280 { 281 if (this->mode_ == T M_EventTriggerAND)281 if (this->mode_ == TriggerMode::EventTriggerAND) 282 282 return std::string("and"); 283 else if (this->mode_ == T M_EventTriggerOR)283 else if (this->mode_ == TriggerMode::EventTriggerOR) 284 284 return std::string("or"); 285 else if (this->mode_ == T M_EventTriggerXOR)285 else if (this->mode_ == TriggerMode::EventTriggerXOR) 286 286 return std::string("xor"); 287 287 else -
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h
r3196 r3280 41 41 namespace orxonox 42 42 { 43 enumTriggerMode43 namespace TriggerMode 44 44 { 45 TM_EventTriggerAND, 46 TM_EventTriggerOR, 47 TM_EventTriggerXOR, 48 }; 45 enum Value 46 { 47 EventTriggerAND, 48 EventTriggerOR, 49 EventTriggerXOR, 50 }; 51 } 49 52 50 53 class _OrxonoxExport Trigger : public StaticEntity, public Tickable … … 64 67 65 68 void setMode(const std::string& modeName); 66 inline void setMode(TriggerMode mode)69 inline void setMode(TriggerMode::Value mode) 67 70 { this->mode_ = mode; } 68 inline TriggerMode getMode() const71 inline TriggerMode::Value getMode() const 69 72 { return mode_; } 70 73 … … 103 106 protected: 104 107 inline bool isTriggered() { return this->isTriggered(this->mode_); } 105 virtual bool isTriggered(TriggerMode mode);108 virtual bool isTriggered(TriggerMode::Value mode); 106 109 virtual void triggered(bool bIsTriggered); 107 110 … … 118 121 bool bFirstTick_; 119 122 120 TriggerMode mode_;123 TriggerMode::Value mode_; 121 124 bool bInvertMode_; 122 125 bool bSwitch_;
Note: See TracChangeset
for help on using the changeset viewer.