Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 30, 2009, 3:14:45 PM (16 years ago)
Author:
rgrieder
Message:

Unified enumeration layout according to the style guide (which I have edited recently ;)).
There is one exception though: XMLPort::Mode. Since that would involve 182 changed files, I have decided not to rename it for now. Moreover its syntax is not too bad ;)

Location:
code/branches/core4/src/orxonox/objects/quest
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/objects/quest/GlobalQuest.cc

    r3196 r3257  
    147147            return false;
    148148        }
    149         return (this->isInactive(player) && !(this->status_ == questStatus::completed || this->status_ == questStatus::failed));
     149        return (this->isInactive(player) && !(this->status_ == QuestStatus::Completed || this->status_ == QuestStatus::Failed));
    150150    }
    151151
     
    189189        Throws an Exception if player is NULL.
    190190    */
    191     questStatus::Enum GlobalQuest::getStatus(const PlayerInfo* player) const
     191    QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
    192192    {
    193193        if(player == NULL) //!< We don't want NULL-Pointers!
     
    203203        }
    204204
    205         return questStatus::inactive;
     205        return QuestStatus::Inactive;
    206206    }
    207207
     
    217217        Returns false if player is NULL.
    218218    */
    219     bool GlobalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
     219    bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
    220220    {
    221221        if(player == NULL) //!< We don't want NULL-Pointers!
  • code/branches/core4/src/orxonox/objects/quest/GlobalQuest.h

    r3196 r3257  
    9797            virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
    9898
    99             virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     99            virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
    100100           
    101             virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     101            virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
    102102
    103103        private:
    104104            std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest.
    105             questStatus::Enum status_; //!< The status of this Quest.
     105            QuestStatus::Value status_; //!< The status of this Quest.
    106106            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
    107107           
  • code/branches/core4/src/orxonox/objects/quest/LocalQuest.cc

    r3196 r3257  
    176176        Throws an Exception if player is NULL.
    177177    */
    178     questStatus::Enum LocalQuest::getStatus(const PlayerInfo* player) const
     178    QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const
    179179    {
    180180        if(player == NULL) //!< No player has no defined status.
     
    183183        }
    184184
    185         std::map<const PlayerInfo*, questStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
     185        std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player);
    186186        if (it != this->playerStatus_.end()) //!< If there is a player in the map.
    187187        {
     
    189189        }
    190190       
    191         return questStatus::inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
     191        return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
    192192    }
    193193
     
    203203        Returns false if player is NULL.
    204204    */
    205     bool LocalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
     205    bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
    206206    {
    207207        if(player == NULL) //!< We can't set a status for no player.
  • code/branches/core4/src/orxonox/objects/quest/LocalQuest.h

    r3196 r3257  
    9191            virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
    9292
    93             virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
    94             virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     93            virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     94            virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
    9595
    9696        private:
    97             std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     97            std::map<const PlayerInfo*, QuestStatus::Value> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    9898
    9999    };
  • code/branches/core4/src/orxonox/objects/quest/Quest.cc

    r3196 r3257  
    302302    bool Quest::isInactive(const PlayerInfo* player) const
    303303    {
    304         return this->getStatus(player) == questStatus::inactive;
     304        return this->getStatus(player) == QuestStatus::Inactive;
    305305    }
    306306
     
    318318    {
    319319
    320         return this->getStatus(player) == questStatus::active;
     320        return this->getStatus(player) == QuestStatus::Active;
    321321    }
    322322
     
    333333    bool Quest::isFailed(const PlayerInfo* player) const
    334334    {
    335         return this->getStatus(player) == questStatus::failed;
     335        return this->getStatus(player) == QuestStatus::Failed;
    336336    }
    337337
     
    348348    bool Quest::isCompleted(const PlayerInfo* player) const
    349349    {
    350         return this->getStatus(player) == questStatus::completed;
     350        return this->getStatus(player) == QuestStatus::Completed;
    351351    }
    352352   
     
    362362    {
    363363        QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
    364         this->setStatus(player, questStatus::failed);
     364        this->setStatus(player, QuestStatus::Failed);
    365365       
    366366        COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
     
    381381    {
    382382        QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
    383         this->setStatus(player, questStatus::completed);
     383        this->setStatus(player, QuestStatus::Completed);
    384384       
    385385        COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
     
    409409        QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
    410410       
    411         this->setStatus(player, questStatus::active);
     411        this->setStatus(player, QuestStatus::Active);
    412412       
    413413        this->getDescription()->sendAddQuestNotification();
  • code/branches/core4/src/orxonox/objects/quest/Quest.h

    r3196 r3257  
    4343namespace orxonox
    4444{
    45     namespace questStatus
     45    namespace QuestStatus
    4646    {
    47 
    4847        //!Different states of a Quest.
    49         enum Enum
     48        enum Value
    5049        {
    51             inactive,
    52             active,
    53             failed,
    54             completed
     50            Inactive,
     51            Active,
     52            Failed,
     53            Completed
    5554        };
    56 
    5755    }
    5856
     
    133131                { return this->completeEffects_; }
    134132
    135             virtual questStatus::Enum getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
    136             virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
     133            virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
     134            virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
    137135           
    138136        private:
  • code/branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r3196 r3257  
    5353        RegisterObject(QuestEffectBeacon);
    5454       
    55         this->status_ = QuestEffectBeaconStatus::active;
     55        this->status_ = QuestEffectBeaconStatus::Active;
    5656        this->times_ = INFINITE_TIME;
    5757    }
     
    162162        if(activate)
    163163        {
    164         this->status_ = QuestEffectBeaconStatus::active;
    165         return true;
    166         }
    167        
    168         this->status_ = QuestEffectBeaconStatus::inactive;
     164        this->status_ = QuestEffectBeaconStatus::Active;
     165        return true;
     166        }
     167       
     168        this->status_ = QuestEffectBeaconStatus::Inactive;
    169169        return true;
    170170    }
     
    190190        if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
    191191        {
    192             this->status_ = QuestEffectBeaconStatus::inactive;
     192            this->status_ = QuestEffectBeaconStatus::Inactive;
    193193        }
    194194       
  • code/branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h

    r3196 r3257  
    4444    namespace QuestEffectBeaconStatus
    4545    {
    46 
    4746        //! The status of the beacon, can be either active or inactive.
    48         enum Enum
     47        enum Value
    4948        {
    50             inactive,
    51             active
     49            Inactive,
     50            Active
    5251        };
    53 
    5452    }
    5553
     
    9896            */
    9997            inline bool isActive(void)
    100             { return this->status_ == QuestEffectBeaconStatus::active; }
     98            { return this->status_ == QuestEffectBeaconStatus::Active; }
    10199           
    102100            bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
     
    117115            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    118116            int times_; //!< Number of times the beacon can be exectued.
    119             QuestEffectBeaconStatus::Enum status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
     117            QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
    120118           
    121119            bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
  • code/branches/core4/src/orxonox/objects/quest/QuestHint.cc

    r3196 r3257  
    9595
    9696        //! Find the player.
    97         std::map<const PlayerInfo*, questHintStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
     97        std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player);
    9898        if (it != this->playerStatus_.end()) //!< If the player is in the map.
    9999        {
     
    101101        }
    102102       
    103         return questStatus::inactive;
     103        return QuestStatus::Inactive;
    104104    }
    105105
     
    118118            if(!(this->isActive(player)))  //!< If the hint is already active, activation is pointless.
    119119            {
    120                 this->playerStatus_[player] = questHintStatus::active;
     120                this->playerStatus_[player] = QuestHintStatus::Active;
    121121               
    122122                this->getDescription()->sendAddHintNotification();
  • code/branches/core4/src/orxonox/objects/quest/QuestHint.h

    r3196 r3257  
    4242namespace orxonox
    4343{
    44     namespace questHintStatus
     44    namespace QuestHintStatus
    4545    {
    46 
    4746        //! The state of the hint.
    48         enum Enum
     47        enum Value
    4948        {
    50             inactive,
    51             active
     49            Inactive,
     50            Active
    5251        };
    53 
    5452    }
    5553
     
    9189        private:
    9290            Quest* quest_; //!< The Quest the QuestHint belongs to.
    93             std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
     91            std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
    9492
    9593    };
  • code/branches/core4/src/orxonox/objects/quest/QuestListener.cc

    r3196 r3257  
    5151        RegisterObject(QuestListener);
    5252       
    53         this->mode_ = questListenerMode::all;
     53        this->mode_ = QuestListenerMode::All;
    5454        this->quest_ = NULL;
    5555    }
     
    132132        if(mode == "all")
    133133        {
    134             this->mode_ = questListenerMode::all;
     134            this->mode_ = QuestListenerMode::All;
    135135        }
    136136        else if(mode == "start")
    137137        {
    138             this->mode_ = questListenerMode::start;
     138            this->mode_ = QuestListenerMode::Start;
    139139        }
    140140        else if(mode == "fail")
    141141        {
    142             this->mode_ = questListenerMode::fail;
     142            this->mode_ = QuestListenerMode::Fail;
    143143        }
    144144        else if(mode == "complete")
    145145        {
    146             this->mode_ = questListenerMode::complete;
     146            this->mode_ = QuestListenerMode::Complete;
    147147        }
    148148        else
    149149        {
    150150            COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl;
    151         this->mode_ = questListenerMode::all;
     151        this->mode_ = QuestListenerMode::All;
    152152        return false;
    153153        }
     
    164164    std::string QuestListener::getMode(void)
    165165    {
    166         if(this->mode_ == questListenerMode::all)
     166        if(this->mode_ == QuestListenerMode::All)
    167167        {
    168168            return "all";
    169169        }
    170         else if(this->mode_ == questListenerMode::start)
     170        else if(this->mode_ == QuestListenerMode::Start)
    171171        {
    172172            return "start";
    173173        }
    174         else if(this->mode_ == questListenerMode::fail)
     174        else if(this->mode_ == QuestListenerMode::Fail)
    175175        {
    176176            return "fail";
    177177        }
    178         else if(this->mode_ == questListenerMode::complete)
     178        else if(this->mode_ == QuestListenerMode::Complete)
    179179        {
    180180            return "complete";
  • code/branches/core4/src/orxonox/objects/quest/QuestListener.h

    r3196 r3257  
    4343namespace orxonox
    4444{
    45     namespace questListenerMode
     45    namespace QuestListenerMode
    4646    {
    47 
    4847        //! The mode of the QuestListener.
    49         enum Enum
     48        enum Value
    5049        {
    51             all,
    52             start,
    53             fail,
    54             complete
     50            All,
     51            Start,
     52            Fail,
     53            Complete
    5554        };
    56 
    5755    }
    5856
     
    9391       
    9492    private:
    95         questListenerMode::Enum mode_; //!< The mode of the QuestListener.
     93        QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
    9694        Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
    9795   
Note: See TracChangeset for help on using the changeset viewer.