Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 28, 2008, 8:37:09 PM (17 years ago)
Author:
landauf
Message:

some changes in Trigger and DistanceTrigger

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h

    r2027 r2029  
    3838#include "tools/BillboardSet.h"
    3939
    40 namespace orxonox {
    41 
     40namespace orxonox
     41{
    4242  enum TriggerMode
    4343  {
     
    5959        { return bActive_; }
    6060
    61       void addTrigger(Trigger* trig);
     61      void addTrigger(Trigger* trigger);
    6262      const Trigger* getTrigger(unsigned int index) const;
    6363
     64      void setMode(const std::string& modeName);
     65      inline void setMode(TriggerMode mode)
     66        { this->mode_ = mode; }
    6467      inline TriggerMode getMode() const
    6568        { return mode_; }
    66       inline void setMode(TriggerMode mode)
    67         { this->mode_ = mode; }
    68       void setMode(const std::string& modeName);
    6969
    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
    7485      inline void setActivations(int activations)
    7586        { this->remainingActivations_ = activations; }
     87      inline int getActivations() const
     88        { return this->remainingActivations_; }
     89
    7690      void setDelay(float delay);
     91      inline float getDelay() const
     92        { return this->delay_; }
     93
    7794      bool switchState();
    7895
    7996      static void debugFlares(bool bVisible);
    8097      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();
    8998
    9099    protected:
     
    93102
    94103    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_;
    97122      float remainingTime_;
    98123      float timeSinceLastEvent_;
    99       TriggerMode mode_;
    100       bool bActive_;
    101       bool bInvertMode_;
    102       bool bTriggered_;
    103       bool bUpdating_;
     124
     125//      bool bUpdating_;
    104126      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_;
    109130  };
    110131
Note: See TracChangeset for help on using the changeset viewer.