Changeset 7601 for code/trunk/src/modules/objects/triggers/Trigger.h
- Timestamp:
- Oct 30, 2010, 1:54:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/triggers/Trigger.h
r5781 r7601 27 27 */ 28 28 29 /** 30 @file Trigger.h 31 @brief Definition of the Trigger class. 32 @ingroup NormalTrigger 33 */ 34 29 35 #ifndef _Trigger_H__ 30 36 #define _Trigger_H__ … … 36 42 37 43 #include "tools/BillboardSet.h" 38 #include "tools/interfaces/Tickable.h" 39 #include " worldentities/StaticEntity.h"44 45 #include "TriggerBase.h" 40 46 41 47 namespace orxonox 42 48 { 43 namespace TriggerMode44 {45 enum Value46 {47 EventTriggerAND,48 EventTriggerOR,49 EventTriggerXOR,50 };51 }52 49 53 class _ObjectsExport Trigger : public StaticEntity, public Tickable 50 /** 51 @brief 52 53 @author 54 Benjamin Knecht 55 56 @ingroup NormalTrigger 57 */ 58 class _ObjectsExport Trigger : public TriggerBase 54 59 { 55 60 public: … … 60 65 virtual void tick(float dt); 61 66 62 inline bool isActive() const 63 { return bActive_; } 64 65 void addTrigger(Trigger* trigger); 66 const Trigger* getTrigger(unsigned int index) const; 67 68 void setMode(const std::string& modeName); 69 inline void setMode(TriggerMode::Value mode) 70 { this->mode_ = mode; } 71 inline TriggerMode::Value getMode() const 72 { return mode_; } 73 74 inline void setInvert(bool bInvert) 75 { this->bInvertMode_ = bInvert; } 76 inline bool getInvert() const 77 { return this->bInvertMode_; } 78 79 inline void setSwitch(bool bSwitch) 80 { this->bSwitch_ = bSwitch; } 81 inline bool getSwitch() const 82 { return this->bSwitch_; } 83 84 inline void setStayActive(bool bStayActive) 85 { this->bStayActive_ = bStayActive; } 86 inline bool getStayActive() const 87 { return this->bStayActive_; } 88 89 inline void setActivations(int activations) 90 { this->remainingActivations_ = activations; } 91 inline int getActivations() const 92 { return this->remainingActivations_; } 67 inline bool isActive(void) const 68 { return this->bActive_; } 93 69 94 70 inline void setVisible(bool visibility) 95 71 { this->debugBillboard_.setVisible(visibility); } 96 72 97 void setDelay(float delay); 98 inline float getDelay() const 99 { return this->delay_; } 73 void delayChanged(void); 100 74 101 75 bool switchState(); … … 115 89 void setBillboardColour(const ColourValue& colour); 116 90 void storeState(); 117 std::string getModeString() const;118 91 119 92 bool bActive_; 120 93 bool bTriggered_; 121 bool bFirstTick_;122 123 TriggerMode::Value mode_;124 bool bInvertMode_;125 bool bSwitch_;126 bool bStayActive_;127 float delay_;128 int remainingActivations_;129 94 130 95 char latestState_; … … 135 100 BillboardSet debugBillboard_; 136 101 137 std::set<Trigger*> children_;138 102 std::queue<std::pair<float, char> > stateChanges_; 139 103 };
Note: See TracChangeset
for help on using the changeset viewer.