Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2093


Ignore:
Timestamp:
Nov 1, 2008, 9:03:51 PM (15 years ago)
Author:
landauf
Message:

converted tabs to spaces

Location:
code/trunk/src/orxonox/objects/quest
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/quest/AddQuest.cc

    r2092 r2093  
    7878        try
    7979        {
    80             Quest* quest = QuestManager::findQuest(this->getQuestId());
    81             if(!quest->start(player))
    82             {
    83                return false;
    84             }
    85         }
    86         catch(const orxonox::Exception& ex)
    87         {
     80            Quest* quest = QuestManager::findQuest(this->getQuestId());
     81            if(!quest->start(player))
     82            {
     83               return false;
     84            }
     85        }
     86        catch(const orxonox::Exception& ex)
     87        {
    8888            COUT(2) << ex.getFullDescription() << std::endl;
    8989            return false;
    90         }
     90        }
    9191
    92         return true;
     92        return true;
    9393    }
    9494
  • code/trunk/src/orxonox/objects/quest/AddQuest.h

    r2092 r2093  
    4747    class AddQuest : public ChangeQuestStatus
    4848    {
    49         public:
     49        public:
    5050            AddQuest(BaseObject* creator);
    51             virtual ~AddQuest();
     51            virtual ~AddQuest();
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5454
    55             virtual bool invoke(Player* player); //!< Invokes the effect.
     55            virtual bool invoke(Player* player); //!< Invokes the effect.
    5656
    5757    };
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.cc

    r2092 r2093  
    8888        {
    8989            QuestHint* hint = QuestManager::findHint(this->hintId_);
    90             if(!hint->activate(player))
    91             {
    92                 return false;
    93             }
    94         }
    95         catch(const Exception& e)
    96         {
    97            COUT(2) << e.getFullDescription() << std::endl;
    98            return false;
    99         }
     90            if(!hint->activate(player))
     91            {
     92                return false;
     93            }
     94        }
     95        catch(const Exception& e)
     96        {
     97           COUT(2) << e.getFullDescription() << std::endl;
     98           return false;
     99        }
    100100
    101         return true;
     101        return true;
    102102
    103103    }
  • code/trunk/src/orxonox/objects/quest/AddQuestHint.h

    r2092 r2093  
    4040    /**
    4141    @brief
    42         Adds a QuestHint, resp. Activates the QuestHint.
     42        Adds a QuestHint, resp. Activates the QuestHint.
    4343    @author
    44         Damian 'Mozork' Frick
     44        Damian 'Mozork' Frick
    4545    */
    4646    class AddQuestHint : public QuestEffect
    4747    {
    48         public:
     48        public:
    4949            AddQuestHint(BaseObject* creator);
    50             virtual ~AddQuestHint();
     50            virtual ~AddQuestHint();
    5151
    52             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     52            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5353
    54             virtual bool invoke(Player* player); //!< Invokes the effect.
     54            virtual bool invoke(Player* player); //!< Invokes the effect.
    5555
    56         private:
     56        private:
    5757            std::string hintId_;
    5858
    5959            inline const std::string & getHintId(void) const
    6060                { return this->hintId_; }
    61             void setHintId(const std::string & id);
     61            void setHintId(const std::string & id);
    6262
    6363    };
  • code/trunk/src/orxonox/objects/quest/AddReward.cc

    r2092 r2093  
    7171        int i = index;
    7272        for (std::list<Rewardable*>::const_iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward)
    73         {
    74             if(i == 0)
    75             {
    76                return *reward;
    77             }
    78             i--;
    79         }
     73        {
     74            if(i == 0)
     75            {
     76               return *reward;
     77            }
     78            i--;
     79        }
    8080        return NULL;
    8181    }
     
    9191    bool AddReward::invoke(Player* player)
    9292    {
    93         bool check = true;
     93        bool check = true;
    9494        for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
    95         {
    96             check = check && (*reward)->reward(player);
    97         }
     95        {
     96            check = check && (*reward)->reward(player);
     97        }
    9898
    99         return check;
     99        return check;
    100100    }
    101101
  • code/trunk/src/orxonox/objects/quest/AddReward.h

    r2092 r2093  
    4242    /**
    4343    @brief
    44         Adds a list of rewards to a player.
     44        Adds a list of rewards to a player.
    4545    @author
    46         Damian 'Mozork' Frick
     46        Damian 'Mozork' Frick
    4747    */
    4848    class AddReward : public QuestEffect
    4949    {
    50         public:
     50        public:
    5151            AddReward(BaseObject* creator);
    52             virtual ~AddReward();
     52            virtual ~AddReward();
    5353
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5555
    56             virtual bool invoke(Player* player); //!< Invokes the effect.
     56            virtual bool invoke(Player* player); //!< Invokes the effect.
    5757
    58         private:
     58        private:
    5959            std::list<Rewardable*> rewards_;
    6060
     
    6363            inline void addRewardable(Rewardable* reward)
    6464                { this->rewards_.push_back(reward); }
    65             const Rewardable* getRewardables(unsigned int index) const;
     65            const Rewardable* getRewardables(unsigned int index) const;
    6666
    6767    };
  • code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h

    r2092 r2093  
    4343        An effect which changes a quests status.
    4444    @author
    45         Damian 'Mozork' Frick
     45        Damian 'Mozork' Frick
    4646    */
    4747    class ChangeQuestStatus : public QuestEffect
    4848    {
    49         public:
     49        public:
    5050            ChangeQuestStatus(BaseObject* creator);
    51             virtual ~ChangeQuestStatus();
     51            virtual ~ChangeQuestStatus();
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5454
    55             virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
     55            virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
    5656
    57         protected:
     57        protected:
    5858            inline const std::string & getQuestId(void) const //!< Returns the quest id.
    5959                { return this->questId_; }
     
    6161            std::string questId_; //!< The id of the quest the status should be changed of.
    6262
    63         private:
    64             void setQuestId(const std::string & id);
     63        private:
     64            void setQuestId(const std::string & id);
    6565
    6666    };
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.cc

    r2092 r2093  
    7474        try
    7575        {
    76             Quest* quest = QuestManager::findQuest(this->getQuestId());
    77             if(!quest->complete(player))
    78             {
    79                return false;
    80             }
    81         }
    82         catch(const Exception& e)
    83         {
     76            Quest* quest = QuestManager::findQuest(this->getQuestId());
     77            if(!quest->complete(player))
     78            {
     79               return false;
     80            }
     81        }
     82        catch(const Exception& e)
     83        {
    8484            COUT(2) << e.getFullDescription() << std::endl;
    8585            return false;
    86         }
     86        }
    8787
    88         return true;
     88        return true;
    8989    }
    9090
  • code/trunk/src/orxonox/objects/quest/CompleteQuest.h

    r2092 r2093  
    4747    class CompleteQuest : public ChangeQuestStatus
    4848    {
    49         public:
     49        public:
    5050            CompleteQuest(BaseObject* creator);
    51             virtual ~CompleteQuest();
     51            virtual ~CompleteQuest();
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5454
    55             virtual bool invoke(Player* player); //!< Invokes the effect.
     55            virtual bool invoke(Player* player); //!< Invokes the effect.
    5656
    5757    };
  • code/trunk/src/orxonox/objects/quest/FailQuest.cc

    r2092 r2093  
    7474        try
    7575        {
    76             Quest* quest = QuestManager::findQuest(this->getQuestId());
    77             if(!quest->fail(player))
    78             {
    79                return false;
    80             }
    81         }
    82         catch(const Exception& e)
    83         {
     76            Quest* quest = QuestManager::findQuest(this->getQuestId());
     77            if(!quest->fail(player))
     78            {
     79               return false;
     80            }
     81        }
     82        catch(const Exception& e)
     83        {
    8484            COUT(2) << e.getFullDescription() << std::endl;
    8585            return false;
    86         }
     86        }
    8787
    88         return true;
     88        return true;
    8989    }
    9090
  • code/trunk/src/orxonox/objects/quest/FailQuest.h

    r2092 r2093  
    4343        Fails a quest.
    4444    @author
    45         Damian 'Mozork' Frick
     45        Damian 'Mozork' Frick
    4646    */
    4747    class FailQuest : public ChangeQuestStatus
    4848    {
    49         public:
     49        public:
    5050            FailQuest(BaseObject* creator);
    51             virtual ~FailQuest();
     51            virtual ~FailQuest();
    5252
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5454
    55             virtual bool invoke(Player* player); //!< Invokes the effect.
     55            virtual bool invoke(Player* player); //!< Invokes the effect.
    5656
    5757    };
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.cc

    r2092 r2093  
    132132        std::set<Player*>::const_iterator it = this->players_.find((Player*)(void*)player);
    133133        if (it != this->players_.end())
    134         {
    135             return this->status_;
    136         }
    137         else
    138         {
    139            return questStatus::inactive;
    140         }
     134        {
     135            return this->status_;
     136        }
     137        else
     138        {
     139           return questStatus::inactive;
     140        }
    141141
    142142    }
     
    145145    @brief
    146146        Sets the status for a specific player.
    147         But be careful wit this one, the status will just be set without checking for its validity. You have to know what you're doing.
     147        But be careful wit this one, the status will just be set without checking for its validity. You have to know what you're doing.
    148148    @param player
    149149        The player.
     
    158158        {
    159159            return false;
    160         }
     160        }
    161161
    162162        std::set<Player*>::const_iterator it = this->players_.find(player);
    163163        if (it == this->players_.end()) //!< Player is not yet in the list.
    164         {
    165             this->players_.insert(player);
    166         }
    167         this->status_ = status;
    168         return true;
     164        {
     165            this->players_.insert(player);
     166        }
     167        this->status_ = status;
     168        return true;
    169169    }
    170170
  • code/trunk/src/orxonox/objects/quest/GlobalQuest.h

    r2092 r2093  
    4848    class GlobalQuest : public Quest
    4949    {
    50         public:
     50        public:
    5151            GlobalQuest(BaseObject* creator);
    52             virtual ~GlobalQuest();
     52            virtual ~GlobalQuest();
    5353
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5555
    56         protected:
     56        protected:
    5757            virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.
    5858            virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.
    5959            virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed.
    6060
    61             virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.
    62             virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     61            virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.
     62            virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    6363
    64         private:
     64        private:
    6565            std::set<Player*> players_; //!< The set of players which possess this quest.
    6666            questStatus::Enum status_; //!< The status of this quest.
  • code/trunk/src/orxonox/objects/quest/LocalQuest.cc

    r2092 r2093  
    127127
    128128        std::map<Player*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((Player*)(void*)player); //Thx. to x3n for the (Player*)(void*) 'hack'.
    129         if (it != this->playerStatus_.end())
    130         {
    131             return it->second;
    132         }
    133         return questStatus::inactive;
     129        if (it != this->playerStatus_.end())
     130        {
     131            return it->second;
     132        }
     133        return questStatus::inactive;
    134134    }
    135135
     
    150150        {
    151151            return false;
    152         }
     152        }
    153153        this->playerStatus_[player] = status;
    154154        return true;
  • code/trunk/src/orxonox/objects/quest/LocalQuest.h

    r2092 r2093  
    4848    class LocalQuest : public Quest
    4949    {
    50         public:
     50        public:
    5151            LocalQuest(BaseObject* creator);
    52             virtual ~LocalQuest();
     52            virtual ~LocalQuest();
    5353
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5555
    56         protected:
     56        protected:
    5757            virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.
    5858            virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.
     
    6262            virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    6363
    64         private:
     64        private:
    6565            std::map<Player*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    6666
  • code/trunk/src/orxonox/objects/quest/Quest.cc

    r2092 r2093  
    135135        }
    136136
    137         this->hints_.push_back(hint);
    138         hint->setQuest(this);
    139 
    140         COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    141         return true;
     137        this->hints_.push_back(hint);
     138        hint->setQuest(this);
     139
     140        COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     141        return true;
    142142    }
    143143
     
    195195        int i = index;
    196196        for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
    197         {
    198             if(i == 0)
    199             {
    200                return *subQuest;
    201             }
    202             i--;
    203         }
     197        {
     198            if(i == 0)
     199            {
     200               return *subQuest;
     201            }
     202            i--;
     203        }
    204204        return NULL;
    205205    }
     
    213213        int i = index;
    214214        for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
    215         {
    216             if(i == 0)
    217             {
    218                return *hint;
    219             }
    220             i--;
    221         }
     215        {
     216            if(i == 0)
     217            {
     218               return *hint;
     219            }
     220            i--;
     221        }
    222222        return NULL;
    223223    }
     
    231231        int i = index;
    232232        for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
    233         {
    234             if(i == 0)
    235             {
    236                return *effect;
    237             }
    238             i--;
    239         }
     233        {
     234            if(i == 0)
     235            {
     236               return *effect;
     237            }
     238            i--;
     239        }
    240240        return NULL;
    241241    }
     
    249249        int i = index;
    250250        for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
    251         {
    252             if(i == 0)
    253             {
    254                return *effect;
    255             }
    256             i--;
    257         }
     251        {
     252            if(i == 0)
     253            {
     254               return *effect;
     255            }
     256            i--;
     257        }
    258258        return NULL;
    259259    }
  • code/trunk/src/orxonox/objects/quest/Quest.h

    r2092 r2093  
    6666    class Quest : public QuestItem
    6767    {
    68         public:
     68        public:
    6969            Quest(BaseObject* creator);
    70             virtual ~Quest();
     70            virtual ~Quest();
    7171
    72             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     72            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    7373
    7474            inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest.
    7575                { return this->parentQuest_; }
    76             inline const std::list<Quest*> & getSubQuestList(void) const //!< Returns the list of sub quests.
     76            inline const std::list<Quest*> & getSubQuestList(void) const //!< Returns the list of sub quests.
    7777                { return this->subQuests_; }
    7878
    79             bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
    80             bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'.
    81             bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
    82             bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
     79            bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     80            bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'.
     81            bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
     82            bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    8383
    84             bool start(Player* player); //!< Sets a quest to active.
    85             bool fail(Player* player); //!< Fails the quest.
    86             bool complete(Player* player); //!< Completes the quest.
     84            bool start(Player* player); //!< Sets a quest to active.
     85            bool fail(Player* player); //!< Fails the quest.
     86            bool complete(Player* player); //!< Completes the quest.
    8787
    8888        protected:
     
    9494
    9595            bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
    96             bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
    97             bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
    98             bool addFailEffect(QuestEffect* effect);
    99             bool addCompleteEffect(QuestEffect* effect);
     96            bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
     97            bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
     98            bool addFailEffect(QuestEffect* effect);
     99            bool addCompleteEffect(QuestEffect* effect);
    100100
    101             const Quest* getParentQuest(void);
    102             const Quest* getSubQuests(unsigned int index) const;
    103             const QuestHint* getHints(unsigned int index) const;
    104             const QuestEffect* getFailEffects(unsigned int index) const;
    105             const QuestEffect* getCompleteEffects(unsigned int index) const;
     101            const Quest* getParentQuest(void);
     102            const Quest* getSubQuests(unsigned int index) const;
     103            const QuestHint* getHints(unsigned int index) const;
     104            const QuestEffect* getFailEffects(unsigned int index) const;
     105            const QuestEffect* getCompleteEffects(unsigned int index) const;
    106106
    107107            virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player.
  • code/trunk/src/orxonox/objects/quest/QuestDescription.h

    r2092 r2093  
    4646    class QuestDescription : public BaseObject {
    4747
    48         public:
     48        public:
    4949            QuestDescription(BaseObject* creator);
    50             virtual ~QuestDescription();
     50            virtual ~QuestDescription();
    5151
    52             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     52            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5353
    54             inline const std::string & getTitle(void) const //!< Returns the title.
     54            inline const std::string & getTitle(void) const //!< Returns the title.
    5555                { return this->title_; }
    56             inline const std::string & getDescription(void) const //!< Returns the description text.
     56            inline const std::string & getDescription(void) const //!< Returns the description text.
    5757                { return this->description_; }
    5858
    59         private:
     59        private:
    6060            void initialize(void);
    6161
    6262            inline void setTitle(const std::string & title) //!< Sets the title.
    6363                { this->title_ = title; }
    64             inline void setDescription(const std::string & description) //!< Sets the description text.
     64            inline void setDescription(const std::string & description) //!< Sets the description text.
    6565                { this->description_ = description; }
    6666
  • code/trunk/src/orxonox/objects/quest/QuestEffect.cc

    r2092 r2093  
    6767
    6868        for (std::list<QuestEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
    69         {
    70             check = check && (*effect)->invoke(player);
    71         }
    72         return check;
     69        {
     70            check = check && (*effect)->invoke(player);
     71        }
     72        return check;
    7373    }
    7474
  • code/trunk/src/orxonox/objects/quest/QuestEffect.h

    r2092 r2093  
    4646    class QuestEffect : public BaseObject
    4747    {
    48         public:
     48        public:
    4949            QuestEffect(BaseObject* creator);
    50             virtual ~QuestEffect();
     50            virtual ~QuestEffect();
    5151
    52             virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
    53             static bool invokeEffects(Player* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.
     52            virtual bool invoke(Player* player) = 0; //!< Invokes the effect.
     53            static bool invokeEffects(Player* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.
    5454
    5555
  • code/trunk/src/orxonox/objects/quest/QuestHint.cc

    r2092 r2093  
    6464    void QuestHint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6565    {
    66         SUPER(QuestHint, XMLPort, xmlelement, mode);
     66        SUPER(QuestHint, XMLPort, xmlelement, mode);
    6767
    68         COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
     68        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
    6969    }
    7070
     
    8989
    9090        std::map<Player*, questHintStatus::Enum>::iterator it = this->playerStatus_.find(player);
    91         if (it != this->playerStatus_.end())
    92         {
    93             return it->second;
    94         }
    95         return questStatus::inactive;
     91        if (it != this->playerStatus_.end())
     92        {
     93            return it->second;
     94        }
     95        return questStatus::inactive;
    9696    }
    9797
     
    108108        if(this->quest_->isActive(player))
    109109        {
    110             if(!(this->isActive(player)))
    111             {
    112                 this->playerStatus_[player] = questHintStatus::active;
    113                 return true;
    114             }
    115             else
    116             {
     110            if(!(this->isActive(player)))
     111            {
     112                this->playerStatus_[player] = questHintStatus::active;
     113                return true;
     114            }
     115            else
     116            {
    117117                COUT(2) << "An already active questHint was trying to get activated." << std::endl;
    118118                return false;
    119             }
     119            }
    120120        }
    121         COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
    122         return false;
     121        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
     122        return false;
    123123    }
    124124
  • code/trunk/src/orxonox/objects/quest/QuestHint.h

    r2092 r2093  
    6565    {
    6666
    67         public:
     67        public:
    6868            QuestHint(BaseObject* creator);
    69             virtual ~QuestHint();
     69            virtual ~QuestHint();
    7070
    71             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     71            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    7272
    73             bool isActive(Player* player); //!< Returns true if the hint is active for the input player.
     73            bool isActive(Player* player); //!< Returns true if the hint is active for the input player.
    7474
    75             bool activate(Player* player); //!< Activates the hint for the input player.
     75            bool activate(Player* player); //!< Activates the hint for the input player.
    7676
    77             bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.
     77            bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.
    7878
    79             inline Quest* getQuest(void)
    80                { return this->quest_; }
     79            inline Quest* getQuest(void)
     80               { return this->quest_; }
    8181
    8282        private:
  • code/trunk/src/orxonox/objects/quest/QuestItem.cc

    r2092 r2093  
    9494        Checks whether an input id is of the required form.
    9595    @param id
    96         The id to be checked.
     96        The id to be checked.
    9797    @return
    9898        Returns true if the string is likely to be of the required form.
  • code/trunk/src/orxonox/objects/quest/QuestItem.h

    r2092 r2093  
    4141    /**
    4242    @brief
    43         Functions as a base class for Quest classes such as Quest or QuestHint.
    44         Has a unique identifier and a description.
     43        Functions as a base class for Quest classes such as Quest or QuestHint.
     44        Has a unique identifier and a description.
    4545    @author
    46         Damian 'Mozork' Frick
     46        Damian 'Mozork' Frick
    4747    */
    4848    class QuestItem : public BaseObject
    4949    {
    5050
    51         public:
     51        public:
    5252            QuestItem(BaseObject* creator);
    53             virtual ~QuestItem();
     53            virtual ~QuestItem();
    5454
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5656
    57             inline const std::string & getId(void) const //!< Returns the id of this quest.
     57            inline const std::string & getId(void) const //!< Returns the id of this quest.
    5858                { return this->id_; }
    59             inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
     59            inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
    6060                { return this->description_; }
    61             //const QuestDescription* getDescription(unsigned int index) const; //!< Returns the description of the QuestItem.
     61            //const QuestDescription* getDescription(unsigned int index) const; //!< Returns the description of the QuestItem.
    6262
    63             static bool isId(const std::string & id); //!< Checks whether a given id is valid.
     63            static bool isId(const std::string & id); //!< Checks whether a given id is valid.
    6464
    65         protected:
    66             void setId(const std::string & id);
    67             inline void setDescription(QuestDescription* description)
     65        protected:
     66            void setId(const std::string & id);
     67            inline void setDescription(QuestDescription* description)
    6868                { this->description_ = description; }
    6969
    70         private:
    71             std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
    72             QuestDescription* description_; //!< The description of the QuestItem.
     70        private:
     71            std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
     72            QuestDescription* description_; //!< The description of the QuestItem.
    7373
    74             void initialize(void); //!< Initializes the object.
     74            void initialize(void); //!< Initializes the object.
    7575
    7676    };
  • code/trunk/src/orxonox/objects/quest/QuestManager.cc

    r2092 r2093  
    6262            COUT(2) << "Registration of Quest in QuestManager failed, because inserted Quest-pointer was NULL." << std::endl;
    6363            return false;
    64         }
     64        }
    6565
    6666        std::pair<std::map<std::string, Quest*>::iterator,bool> ret;
     
    7171            COUT(3) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
    7272            return true;
    73         }
    74         else
    75         {
    76            COUT(2) << "Quest with the same id was already present." << std::endl;
    77            return false;
    78         }
     73        }
     74        else
     75        {
     76           COUT(2) << "Quest with the same id was already present." << std::endl;
     77           return false;
     78        }
    7979    }
    8080
     
    102102            COUT(3) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
    103103            return true;
    104         }
    105         else
    106         {
    107            COUT(2) << "QuestHint with the same id was already present." << std::endl;
    108            return false;
    109         }
     104        }
     105        else
     106        {
     107           COUT(2) << "QuestHint with the same id was already present." << std::endl;
     108           return false;
     109        }
    110110    }
    111111
     
    124124    {
    125125        if(!QuestItem::isId(questId))
    126         {
     126        {
    127127            ThrowException(Argument, "Invalid questId.");
    128         }
     128        }
    129129
    130130        Quest* quest;
    131131        std::map<std::string, Quest*>::iterator it = questMap_.find(questId);
    132         if (it != questMap_.end())
    133         {
    134             quest = it->second;
    135         }
    136         else
    137         {
    138            quest = NULL;
    139            COUT(2) << "The quest with id {" << questId << "} is nowhere to be found." << std::endl;
    140         }
     132        if (it != questMap_.end())
     133        {
     134            quest = it->second;
     135        }
     136        else
     137        {
     138           quest = NULL;
     139           COUT(2) << "The quest with id {" << questId << "} is nowhere to be found." << std::endl;
     140        }
    141141
    142         return quest;
     142        return quest;
    143143
    144144    }
     
    158158    {
    159159        if(!QuestItem::isId(hintId))
    160         {
     160        {
    161161            ThrowException(Argument, "Invalid hintId.");
    162         }
     162        }
    163163
    164164        QuestHint* hint;
    165165        std::map<std::string, QuestHint*>::iterator it = hintMap_.find(hintId);
    166         if (it != hintMap_.end())
    167         {
    168             hint = it->second;
    169         }
    170         else
    171         {
    172            hint = NULL;
    173            COUT(2) << "The hint with id {" << hintId << "} is nowhere to be found." << std::endl;
    174         }
     166        if (it != hintMap_.end())
     167        {
     168            hint = it->second;
     169        }
     170        else
     171        {
     172           hint = NULL;
     173           COUT(2) << "The hint with id {" << hintId << "} is nowhere to be found." << std::endl;
     174        }
    175175
    176         return hint;
     176        return hint;
    177177
    178178    }
  • code/trunk/src/orxonox/objects/quest/QuestManager.h

    r2092 r2093  
    4949    {
    5050
    51         public:
    52             QuestManager(BaseObject* creator);
    53             virtual ~QuestManager();
     51        public:
     52            QuestManager(BaseObject* creator);
     53            virtual ~QuestManager();
    5454
    55             static bool registerQuest(Quest* quest); //!< Registers a quest in the QuestManager.
    56             static bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager.
     55            static bool registerQuest(Quest* quest); //!< Registers a quest in the QuestManager.
     56            static bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager.
    5757
    58             static Quest* findQuest(const std::string & questId); //!< Returns the quest with the input id.
    59             static QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id.
     58            static Quest* findQuest(const std::string & questId); //!< Returns the quest with the input id.
     59            static QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id.
    6060
    61         private:
    62             static std::map<std::string, Quest*> questMap_; //!< All quests registered by their id's.
    63             static std::map<std::string, QuestHint*> hintMap_; //!< All hints registered by their id's.
     61        private:
     62            static std::map<std::string, Quest*> questMap_; //!< All quests registered by their id's.
     63            static std::map<std::string, QuestHint*> hintMap_; //!< All hints registered by their id's.
    6464
    6565    };
  • code/trunk/src/orxonox/objects/quest/Rewardable.h

    r2092 r2093  
    4545    {
    4646
    47         public:
    48             Rewardable(BaseObject* creator);
    49             virtual ~Rewardable();
     47        public:
     48            Rewardable(BaseObject* creator);
     49            virtual ~Rewardable();
    5050
    51             virtual bool reward(Player* player) = 0; //!<Method to transcribe a rewardable object to the player.
     51            virtual bool reward(Player* player) = 0; //!<Method to transcribe a rewardable object to the player.
    5252
    5353    };
Note: See TracChangeset for help on using the changeset viewer.