Changeset 2029 for code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h
- Timestamp:
- Oct 28, 2008, 8:37:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h
r2027 r2029 38 38 #include "tools/BillboardSet.h" 39 39 40 namespace orxonox {41 40 namespace orxonox 41 { 42 42 enum TriggerMode 43 43 { … … 59 59 { return bActive_; } 60 60 61 void addTrigger(Trigger* trig );61 void addTrigger(Trigger* trigger); 62 62 const Trigger* getTrigger(unsigned int index) const; 63 63 64 void setMode(const std::string& modeName); 65 inline void setMode(TriggerMode mode) 66 { this->mode_ = mode; } 64 67 inline TriggerMode getMode() const 65 68 { return mode_; } 66 inline void setMode(TriggerMode mode)67 { this->mode_ = mode; }68 void setMode(const std::string& modeName);69 69 70 inline void setInvert(int invert) 71 { bInvertMode_ = invert; } 72 inline void setStayOn(int stayOn) 73 { this->bStayOn_ = (stayOn == 1) ? true : false; } 70 inline void setInvert(bool bInvert) 71 { this->bInvertMode_ = bInvert; } 72 inline bool getInvert() const 73 { return this->bInvertMode_; } 74 75 inline void setSwitch(bool bSwitch) 76 { this->bSwitch_ = bSwitch; } 77 inline bool getSwitch() const 78 { return this->bSwitch_; } 79 80 inline void setStayActive(bool bStayActive) 81 { this->bStayActive_ = bStayActive; } 82 inline bool getStayActive() const 83 { return this->bStayActive_; } 84 74 85 inline void setActivations(int activations) 75 86 { this->remainingActivations_ = activations; } 87 inline int getActivations() const 88 { return this->remainingActivations_; } 89 76 90 void setDelay(float delay); 91 inline float getDelay() const 92 { return this->delay_; } 93 77 94 bool switchState(); 78 95 79 96 static void debugFlares(bool bVisible); 80 97 virtual void changedVisibility(); 81 82 private:83 void init();84 bool checkAnd();85 bool checkOr();86 bool checkXor();87 void setBillboardColour(ColourValue colour);88 void storeState();89 98 90 99 protected: … … 93 102 94 103 private: 95 std::set<Trigger*> children_; 96 std::queue<std::pair<float,char> > stateChanges_; 104 bool checkAnd(); 105 bool checkOr(); 106 bool checkXor(); 107 void setBillboardColour(const ColourValue& colour); 108 void storeState(); 109 std::string getModeString() const; 110 111 bool bActive_; 112 bool bTriggered_; 113 114 TriggerMode mode_; 115 bool bInvertMode_; 116 bool bSwitch_; 117 bool bStayActive_; 118 float delay_; 119 int remainingActivations_; 120 121 char latestState_; 97 122 float remainingTime_; 98 123 float timeSinceLastEvent_; 99 TriggerMode mode_; 100 bool bActive_; 101 bool bInvertMode_; 102 bool bTriggered_; 103 bool bUpdating_; 124 125 // bool bUpdating_; 104 126 BillboardSet debugBillboard_; 105 float delay_; 106 int remainingActivations_; 107 bool bStayOn_; 108 char latestState_; 127 128 std::set<Trigger*> children_; 129 std::queue<std::pair<float, char> > stateChanges_; 109 130 }; 110 131
Note: See TracChangeset
for help on using the changeset viewer.