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/GlobalQuest.h

    r2096 r2146  
    2626 *
    2727 */
     28 
     29/**
     30    @file GlobalQuest.h
     31    @brief
     32        Definition of the GlobalQuest class.
     33*/
    2834
    2935#ifndef _GlobalQuest_H__
     
    3339
    3440#include <set>
     41#include <list>
    3542
    3643#include "core/XMLPort.h"
     
    3946namespace orxonox {
    4047
    41     class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
    42 
    4348    /**
    4449    @brief
    4550        Global quests are quests, that have the same status for all players.
    46         This means, that when a player successfully completes this quest, it is completed for all players that have it.
     51        This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
     52       
     53        Creating a GlobalQuest through XML goes as follows:
     54       
     55        <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
     56            <QuestDescription title="Title" description="Description." /> //The description of the quest.
     57            <subquests>
     58                <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well.
     59                ...
     60                <Quest id="questIdn" />
     61            </subquests>
     62            <hints>
     63                <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those.
     64                ...
     65                <QuestHint id="hintIdn" />
     66            </hints>
     67            <fail-effects>
     68                <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation.
     69                ...
     70                <QuestEffect />
     71            </fail-effects>
     72            <complete-effects>
     73                <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is completed, see QuestEffect for the full XML representation.
     74                ...
     75                <QuestEffect />
     76            </complete-effects>
     77            <reward-effects>
     78                <QuestEffect /> //A list of QuestEffects, invoked on the player completing this quest. See QuestEffect for the full XML representation.
     79                ...
     80                <QuestEffect />
     81            </reward-effects>
     82        </GlobalQuest>
    4783    @author
    4884        Damian 'Mozork' Frick
     
    5490            virtual ~GlobalQuest();
    5591
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     92            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
     93           
     94            virtual bool fail(ControllableEntity* player); //!< Fails the quest.
     95            virtual bool complete(ControllableEntity* player); //!< Completes the quest.
    5796
    5897        protected:
    59             virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.
    60             virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.
    61             virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed.
     98            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
     99            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
     100            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
    62101
    63             virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.
    64             virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
     102            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
     103            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    65104
    66105        private:
    67             std::set<Player*> players_; //!< The set of players which possess this quest.
     106            std::set<ControllableEntity*> players_; //!< The set of players which possess this quest.
    68107            questStatus::Enum status_; //!< The status of this quest.
     108            std::list<QuestEffect*> rewards_; //!< Reward effects only invoked on the player completing the quest.
     109           
     110            bool addRewardEffect(QuestEffect* effect); //!< Adds a reward effect to the list of reward effects.
     111            const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index.
    69112
    70             void initialize(void);
     113            void initialize(void); //!< Initializes the object.
    71114
    72115    };
Note: See TracChangeset for help on using the changeset viewer.