Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2258


Ignore:
Timestamp:
Nov 25, 2008, 8:39:00 AM (15 years ago)
Author:
dafrick
Message:

Finalizing, found an error…

Location:
code/branches/questsystem2/src/orxonox/objects/quest
Files:
3 edited

Legend:

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

    r2251 r2258  
    147147    bool GlobalQuest::isStartable(const PlayerInfo* player) const
    148148    {
     149        if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     150        {
     151            return false;
     152        }
    149153        return (this->isInactive(player) && !(this->status_ == questStatus::completed || this->status_ == questStatus::failed));
    150154    }
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc

    r2251 r2258  
    131131    bool LocalQuest::isStartable(const PlayerInfo* player) const
    132132    {
     133        if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player)))
     134        {
     135            return false;
     136        }
    133137        return this->isInactive(player);
    134138    }
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.h

    r2251 r2258  
    9090                { return this->parentQuest_; }
    9191               
    92         /**
    93         @brief Returns the list of subquests.
    94         @return Returns a reference to the list of subquests of the quest.
    95         */
    96             inline const std::list<Quest*> & getSubQuestList(void) const
    97                 { return this->subQuests_; }
    98                
    99         /**
    100         @brief Returns the list of all QuestHints of this Quest.
    101         @return Returns a reference to the list of QuestHints of the Quest.
    102         */
    103         inline const std::list<QuestHint*> & getHintsList(void) const
    104                 { return this->hints_; }
    105 
    106             bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
    107             bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
    108             bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
    109             bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    110 
    111             bool start(PlayerInfo* player); //!< Sets a Quest to active.
    112         virtual bool fail(PlayerInfo* player) = 0; //!< Fails the Quest.
    113             virtual bool complete(PlayerInfo* player) = 0; //!< Completes the Quest.
     92            /**
     93            @brief Returns the list of subquests.
     94            @return Returns a reference to the list of subquests of the quest.
     95            */
     96            inline const std::list<Quest*> & getSubQuestList(void) const
     97                { return this->subQuests_; }
     98                   
     99            /**
     100            @brief Returns the list of all QuestHints of this Quest.
     101            @return Returns a reference to the list of QuestHints of the Quest.
     102            */
     103            inline const std::list<QuestHint*> & getHintsList(void) const
     104                { return this->hints_; }
     105           
     106            bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     107            bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
     108            bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
     109            bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
     110           
     111            bool start(PlayerInfo* player); //!< Sets a Quest to active.
     112            virtual bool fail(PlayerInfo* player) = 0; //!< Fails the Quest.
     113            virtual bool complete(PlayerInfo* player) = 0; //!< Completes the Quest.
    114114
    115115        protected:
     
    131131                { return this->failEffects_; }
    132132               
    133         /**
    134         @brief Returns the list of complete QuestEffects.
    135         @return Returns a reference to the list of complete QuestEffects.
    136         */
    137         inline std::list<QuestEffect*> & getCompleteEffectList(void)
     133            /**
     134            @brief Returns the list of complete QuestEffects.
     135            @return Returns a reference to the list of complete QuestEffects.
     136            */
     137            inline std::list<QuestEffect*> & getCompleteEffectList(void)
    138138                { return this->completeEffects_; }
    139139
Note: See TracChangeset for help on using the changeset viewer.