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

    r2096 r2146  
    2626 *
    2727 */
     28 
     29/**
     30    @file LocalQuest.h
     31    @brief
     32        Definition of the LocalQuest class.
     33*/
    2834
    2935#ifndef _LocalQuest_H__
     
    4046namespace orxonox {
    4147
    42     class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
    43 
    4448    /**
    4549    @brief
    4650        Handles quests which have different states for different players.
     51        LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest.
     52       
     53        Creating a LocalQuest through XML goes as follows:
     54       
     55        <LocalQuest 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 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 when the Quest is completed, see QuestEffect for the full XML representation.
     74                ...
     75                <QuestEffect />
     76            </complete-effects>
     77        </LocalQuest>
    4778    @author
    4879        Damian 'Mozork' Frick
     
    5485            virtual ~LocalQuest();
    5586
    56             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     87            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
     88           
     89            virtual bool fail(ControllableEntity* player); //!< Fails the quest.
     90            virtual bool complete(ControllableEntity* player); //!< Completes the quest.
    5791
    5892        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.
     93            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
     94            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
     95            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
    6296
    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.
     97            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
     98            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    6599
    66100        private:
    67             std::map<Player*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     101            std::map<ControllableEntity*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    68102
    69             void initialize(void);
     103            void initialize(void); //!< Initializes the object.
    70104
    71105    };
    72 
    73106
    74107}
Note: See TracChangeset for help on using the changeset viewer.