Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2008, 11:56:40 PM (15 years ago)
Author:
landauf
Message:

merged questsystem2 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/quest/LocalQuest.h

    r2096 r2261  
    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
    46         Handles quests which have different states for different players.
     50        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(PlayerInfo* player); //!< Fails the Quest.
     90            virtual bool complete(PlayerInfo* 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 PlayerInfo* player) const; //!< Checks whether the Quest can be started.
     94            virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
     95            virtual bool isCompletable(const PlayerInfo* 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 PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
     98            virtual bool setStatus(PlayerInfo* 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.
    68 
    69             void initialize(void);
     101            std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    70102
    71103    };
    72 
    73104
    74105}
Note: See TracChangeset for help on using the changeset viewer.