Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 15, 2010, 7:29:16 PM (14 years ago)
Author:
dafrick
Message:

Reviewing documentation fo Questsystem, moving documentation fully into doxygen.
Added some files to modules they belong to.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.cc

    r7401 r7456  
    2828
    2929/**
    30     @file
     30    @file QuestEffectBeacon.cc
    3131    @brief Implementation of the QuestEffectBeacon class.
    3232*/
     
    3737#include "core/XMLPort.h"
    3838#include "core/EventIncludes.h"
     39
     40#include "interfaces/PlayerTrigger.h"
    3941#include "worldentities/pawns/Pawn.h"
    40 #include "interfaces/PlayerTrigger.h"
     42
    4143#include "objects/triggers/MultiTriggerContainer.h"
    4244#include "QuestEffect.h"
     
    5052        Constructor. Registers the object and initializes defaults.
    5153    */
     54    //TODO: Make just BaseObject?
    5255    QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : StaticEntity(creator)
    5356    {
     
    99102        Returns true if successfully executed, false if not.
    100103    */
     104    //TODO: Eliminate MultiTriggerContainer stuff, since they are now PlayerTriggers as well.
    101105    bool QuestEffectBeacon::execute(bool bTriggered, BaseObject* trigger)
    102106    {
     
    105109            return false;
    106110        }
    107         if(!(this->isActive())) //!< If the QuestEffectBeacon is inactive it cannot be executed.
     111        if(!(this->isActive())) // If the QuestEffectBeacon is inactive it cannot be executed.
    108112        {
    109113            COUT(4) << "The QuestEffectBeacon is inactive." << std::endl;
     
    115119        Pawn* pawn = NULL;
    116120
    117         //! If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it.
     121        // If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it.
    118122        if(pTrigger == NULL && mTrigger == NULL)
    119123            return false;
     
    122126        if(pTrigger != NULL)
    123127        {
    124             if(!pTrigger->isForPlayer())  //!< The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     128            if(!pTrigger->isForPlayer())  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
    125129                return false;
    126130            else
     
    140144        }
    141145
    142         //! Extract the PlayerInfo from the Pawn.
     146        // Extract the PlayerInfo from the Pawn.
    143147        PlayerInfo* player = pawn->getPlayer();
    144148
     
    151155        COUT(4) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
    152156
    153         bool check = QuestEffect::invokeEffects(player, this->effects_); //!< Invoke the QuestEffects on the PlayerInfo.
     157        bool check = QuestEffect::invokeEffects(player, this->effects_); // Invoke the QuestEffects on the PlayerInfo.
    154158        if(check)
    155159        {
    156             this->decrementTimes(); //!< Decrement the number of times the beacon can be used.
     160            this->decrementTimes(); // Decrement the number of times the beacon can be used.
    157161            return true;
    158162        }
     
    171175    bool QuestEffectBeacon::setActive(bool activate)
    172176    {
    173         if(this->getTimes() == 0 && activate) //!< A QuestEffectBeacon that can be executed only 0 times is always inactive.
    174         {
    175             return false;
    176         }
     177        if(this->getTimes() == 0 && activate) // A QuestEffectBeacon that can be executed only 0 times is always inactive.
     178            return false;
    177179
    178180        if(activate)
    179181        {
    180         this->status_ = QuestEffectBeaconStatus::Active;
    181         return true;
     182            this->status_ = QuestEffectBeaconStatus::Active;
     183            return true;
    182184        }
    183185
     
    194196    bool QuestEffectBeacon::decrementTimes(void)
    195197    {
    196         if(!(this->isActive())) //!< The QuestEffectBeacon mus be active to decrement the number of times it can be executed.
    197         {
    198             return false;
    199         }
    200         if(this->getTimes() == INFINITE_TIME) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
    201         {
     198        if(!(this->isActive())) // The QuestEffectBeacon mus be active to decrement the number of times it can be executed.
     199            return false;
     200
     201        if(this->getTimes() == INFINITE_TIME) // If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
    202202            return true;
    203         }
    204 
    205         this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed.
    206         if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
    207         {
     203
     204        this->times_ = this->times_ - 1; // Decrement number of times the QuestEffectBeacon can be executed.
     205        if(this->getTimes() == 0) // Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
    208206            this->status_ = QuestEffectBeaconStatus::Inactive;
    209         }
    210207
    211208        return true;
     
    225222    {
    226223        if(n < 0 && n != INFINITE_TIME)
    227         {
    228             return false;
    229         }
     224            return false;
    230225
    231226        this->times_ = n;
     
    243238    bool QuestEffectBeacon::addEffect(QuestEffect* effect)
    244239    {
    245         if(effect == NULL) //!< NULL-pointers are not well liked here...
     240        //TODO: Replace with assert.
     241        if(effect == NULL) // NULL-pointers are not well liked here...
    246242        {
    247243            COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
     
    269265        {
    270266            if(i == 0)
    271             {
    272267               return *effect;
    273             }
     268
    274269            i--;
    275270        }
Note: See TracChangeset for help on using the changeset viewer.