Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2010, 1:54:49 PM (14 years ago)
Author:
dafrick
Message:

Adding all classes in modules/objects to Objects module (in doxygen).
Created TriggerBase which is the base class of Trigger and MultiTrigger and now provides the shared functionality and data.
Updated some of the documentation in MultiTrigger and Script.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/objects/triggers/Trigger.h

    r5781 r7601  
    2727 */
    2828
     29/**
     30    @file Trigger.h
     31    @brief Definition of the Trigger class.
     32    @ingroup NormalTrigger
     33*/
     34
    2935#ifndef _Trigger_H__
    3036#define _Trigger_H__
     
    3642
    3743#include "tools/BillboardSet.h"
    38 #include "tools/interfaces/Tickable.h"
    39 #include "worldentities/StaticEntity.h"
     44
     45#include "TriggerBase.h"
    4046
    4147namespace orxonox
    4248{
    43   namespace TriggerMode
    44   {
    45     enum Value
    46     {
    47       EventTriggerAND,
    48       EventTriggerOR,
    49       EventTriggerXOR,
    50     };
    51   }
    5249
    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
    5459  {
    5560    public:
     
    6065      virtual void tick(float dt);
    6166
    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_; }
    9369
    9470      inline void setVisible(bool visibility)
    9571        { this->debugBillboard_.setVisible(visibility); }
    9672
    97       void setDelay(float delay);
    98       inline float getDelay() const
    99         { return this->delay_; }
     73      void delayChanged(void);
    10074
    10175      bool switchState();
     
    11589      void setBillboardColour(const ColourValue& colour);
    11690      void storeState();
    117       std::string getModeString() const;
    11891
    11992      bool bActive_;
    12093      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_;
    12994
    13095      char latestState_;
     
    135100      BillboardSet debugBillboard_;
    136101
    137       std::set<Trigger*> children_;
    138102      std::queue<std::pair<float, char> > stateChanges_;
    139103  };
Note: See TracChangeset for help on using the changeset viewer.