Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2008, 12:02:05 AM (16 years ago)
Author:
dafrick
Message:

Started implementation of QuestEffectBeacon.
Done some documentation of QuestItem and subclasses.

File:
1 edited

Legend:

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

    r2096 r2146  
    2626 *
    2727 */
    28 
     28 
     29/**
     30    @file Quest.h
     31    @brief
     32        Definition of the Quest class.
     33       
     34        The Quest is the parent class of LocalQuest and GlobalQuest.
     35*/
     36 
    2937#ifndef _Quest_H__
    3038#define _Quest_H__
     
    3846#include "QuestItem.h"
    3947
     48
    4049namespace questStatus
    4150{
    4251
     52    //!Different states of a quest.
    4353    enum Enum
    4454    {
     
    5363namespace orxonox {
    5464
    55     class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
    56 
    5765    /**
    5866    @brief
     
    6068        A quest has a list of subquests and a parentquest (if it is not a rootquest).
    6169        Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player.
     70        A quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the quest.
     71        A quest has a list of QuestEffects that are invoked when the quest is failed and also a list of effects that are invoked, when the quest is completed.
     72       
     73        Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
    6274    @author
    6375        Damian 'Mozork' Frick
     
    6981            virtual ~Quest();
    7082
    71             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     83            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML.
    7284
    7385            inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest.
     
    7688                { return this->subQuests_; }
    7789
    78             bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
    79             bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'.
    80             bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
    81             bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
     90            bool isInactive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     91            bool isActive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'active'.
     92            bool isFailed(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
     93            bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    8294
    83             bool start(Player* player); //!< Sets a quest to active.
    84             bool fail(Player* player); //!< Fails the quest.
    85             bool complete(Player* player); //!< Completes the quest.
     95            bool start(ControllableEntity* player); //!< Sets a quest to active.
     96            virtual bool fail(ControllableEntity* player) = 0; //!< Fails the quest.
     97            virtual bool complete(ControllableEntity* player) = 0; //!< Completes the quest.
    8698
    8799        protected:
    88             void initialize(void); //!< Initialized the object.
     100            void initialize(void); //!< Initializes the object.
    89101
    90             virtual bool isStartable(const Player* player) const = 0; //!< Checks whether the quest can be started.
    91             virtual bool isFailable(const Player* player) const = 0; //!< Checks whether the quest can be failed.
    92             virtual bool isCompletable(const Player* player) const = 0; //!< Checks whether the quest can be completed.
     102            virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started.
     103            virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed.
     104            virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed.
    93105
    94106            bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
    95107            bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
    96108            bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
    97             bool addFailEffect(QuestEffect* effect);
    98             bool addCompleteEffect(QuestEffect* effect);
     109            bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects.
     110            bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects.
    99111
    100             const Quest* getParentQuest(void);
    101             const Quest* getSubQuests(unsigned int index) const;
    102             const QuestHint* getHints(unsigned int index) const;
    103             const QuestEffect* getFailEffects(unsigned int index) const;
    104             const QuestEffect* getCompleteEffects(unsigned int index) const;
     112            const Quest* getParentQuest(void); //!< Returns the parent quest of the quest.
     113            const Quest* getSubQuests(unsigned int index) const; //!<Returns the sub quest of the given index.
     114            const QuestHint* getHints(unsigned int index) const; //!< Returns the hint of the given index.
     115            const QuestEffect* getFailEffects(unsigned int index) const; //!< Returns the failEffect of the given index.
     116            const QuestEffect* getCompleteEffects(unsigned int index) const; //!Returns the completeEffect of the given index.
    105117
    106             virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player.
    107             virtual bool setStatus(Player* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
     118            virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player.
     119            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
    108120
    109121            Quest* parentQuest_; //!< Pointer to the parent quest.
Note: See TracChangeset for help on using the changeset viewer.