Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 22, 2008, 4:03:10 PM (16 years ago)
Author:
dafrick
Message:

Some cleaning, reorganization and implementation of some small methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem/src/orxonox/objects/Quest.h

    r1992 r1996  
    3333#include <string>
    3434
    35 #include "orxonox/quests/QuestDescription.h"
     35#include "QuestDescription.h"
    3636#include "QuestItem.h"
    3737#include "QuestHint.h"
     
    5252        public:
    5353            Quest(std::string id, std::string title = "", std::string description = "");
    54             ~Quest();
     54            virtual ~Quest();
    5555   
    5656            inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest.
     
    6060           
    6161            //TDO: Necessary? Shouldn't this be decided whilest creating the object?
    62             inline void setParentQuest(Quest* quest) //!< Sets the parent quest of the quest.
    63                 { this->parentQuest_ = quest; }
    64             inline void addSubQuest(Quest & quest) //!< Adds a sub quest to the quest.
    65                 { this->subQuests_.push_back = quest; }
     62            bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
     63            bool addSubQuest(Quest & quest); //!< Adds a sub quest to the quest.
    6664           
    6765            inline bool isInactive(const Player & player) const //!< Returns true if the quest status for the specific player is 'inactive'.
    68                { return this->getStatus(player) != questStatus::inactive; }
     66               { return this->getStatus(player) == questStatus::inactive; }
    6967            inline bool isActive(const Player & player) const //!< Returns true if the quest status for the specific player is 'active'.
    7068               { return this->getStatus(player) == questStatus::active; }
     
    7472               { return this->getStatus(player) == questStatus::completed; }
    7573               
    76             void start(const Player & player); //!< Sets a quest to pending.
    77             void fail(Player & player); //!< Fails the quest.
    78             void complete(Player & player); //!< Completes the quest.
     74            bool start(const Player & player); //!< Sets a quest to active.
     75            bool fail(Player & player); //!< Fails the quest.
     76            bool complete(Player & player); //!< Completes the quest.
    7977               
    8078            void addHint(QuestHint & hint); //!< Add a hint to the list of hints.
     
    8280        protected:
    8381            void initialize(void); //!< Initialized the object.
     82           
     83            virtual bool isStartable(const Player & player) const = 0; //!< Checks whether the quest can be started.
     84            virtual bool isFailable(const Player & player) const = 0; //!< Checks whether the quest can be failed.
     85            virtual bool isCompletable(const Player & player) const = 0; //!< Checks whether the quest can be completed.
    8486           
    8587            virtual questStatus::Enum getStatus(const Player & player) const = 0; //!< Returns the status of the quest for a specific player.
Note: See TracChangeset for help on using the changeset viewer.