Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 4:19:44 PM (15 years ago)
Author:
dafrick
Message:

Merged questsystem3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2262 r2385  
    2929/**
    3030    @file QuestEffectBeacon.h
    31     @brief
    32     Definition of the QuestEffectBeacon class.
     31    @brief Definition of the QuestEffectBeacon class.
    3332*/
    3433
     
    6160        A QuestEffectBeacon can be inactive or active.
    6261       
    63     Creating a QuestEffectBeacon through XML goes as follows:
    64    
    65     <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
     62        Creating a QuestEffectBeacon through XML goes as follows:
     63       
     64        <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
    6665            <effects>
    6766                <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation.
     
    7069            </effects>
    7170            <events>
    72         <execute>
    73             <EventListener event=eventIdString />
    74         </execute>
    75         </events>
    76         <attached>
    77            <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
    78         </attached>
    79     </QuestEffectBeacon>
     71                <execute>
     72                    <EventListener event=eventIdString />
     73                </execute>
     74            </events>
     75            <attached>
     76                <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
     77            </attached>
     78        </QuestEffectBeacon>
    8079    @author
    8180        Damian 'Mozork' Frick
     
    8382    class _OrxonoxExport QuestEffectBeacon : public PositionableEntity
    8483    {
    85     public:
    86         QuestEffectBeacon(BaseObject* creator);
    87         virtual ~QuestEffectBeacon();
    88        
    89         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
    90        
    91         virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
    92        
    93         bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
    94        
    95         /**
    96         @brief Tests whether the QuestEffectBeacon is active.
    97         @return Returns true if the QuestEffectBeacon is active, fals if not.
    98         */
    99         inline bool isActive(void)
    100            { return this->status_ == QuestEffectBeaconStatus::active; }
    101        
    102         bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
    103        
    104     protected:
     84        public:
     85            QuestEffectBeacon(BaseObject* creator);
     86            virtual ~QuestEffectBeacon();
     87           
     88            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
     89           
     90            virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
     91           
     92            bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
     93           
     94            /**
     95            @brief Tests whether the QuestEffectBeacon is active.
     96            @return Returns true if the QuestEffectBeacon is active, fals if not.
     97            */
     98            inline bool isActive(void)
     99            { return this->status_ == QuestEffectBeaconStatus::active; }
     100           
     101            bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
     102           
     103        protected:
    105104            bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed.
    106105           
     
    111110            inline const int & getTimes(void) const
    112111                { return this->times_; }
    113 
     112   
    114113        private:
    115114            static const int INFINITE = -1; //!< Constant to avoid using magic numbers.
    116        
     115           
    117116            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    118117            int times_; //!< Number of times the beacon can be exectued.
Note: See TracChangeset for help on using the changeset viewer.