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

    r2096 r2261  
    2626 *
    2727 */
     28 
     29/**
     30    @file QuestHint.h
     31    @brief
     32    Definition of the QuestHint class.
     33*/
    2834
    2935#ifndef _QuestHint_H__
     
    4147{
    4248
     49    //! The status of the hint.
    4350    enum Enum
    4451    {
     
    5259{
    5360
    54     class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.
    55 
    5661    /**
    5762    @brief
    5863        Represents a hint in the game towards completing a Quest.
    59         Consists of title and description in textual form and must belong to a quest.
    60         A QuestHit has a defined status (inactive or active, where inactive is default) for each player, which means each QuestHint exists only once for all players, it doesn't belong to a player, it just has different stati for each of them.
     64        Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
     65        A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
     66       
     67        Creating a QuestHint through XML goes as follows:
     68       
     69        <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
     70            <QuestDesctription title="" description="" />
     71        </QuestHint>
    6172    @author
    6273        Damian 'Mozork' Frick
     
    6980            virtual ~QuestHint();
    7081
    71             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     82            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
    7283
    73             bool isActive(Player* player); //!< Returns true if the hint is active for the input player.
     84            bool isActive(const PlayerInfo* player) const; //!< Returns true if the QuestHint is active for the input player.
    7485
    75             bool activate(Player* player); //!< Activates the hint for the input player.
     86            bool setActive(PlayerInfo* player); //!< Activates the QuestHint for the input player.
     87            bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to.
    7688
    77             bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.
    78 
     89            /**
     90            @brief Returns the Quest the QuestHint is attached to.
     91            @return  Returns a pointer to the Quest the QuestHint is attached to.
     92            */
    7993            inline Quest* getQuest(void)
    8094               { return this->quest_; }
    8195
    8296        private:
    83 
    84             void initialize(void);
    85 
    86             Quest* quest_; //!< The quest the hint belongs to.
    87             std::map<Player*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     97            Quest* quest_; //!< The Quest the QuestHint belongs to.
     98            std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    8899
    89100    };
Note: See TracChangeset for help on using the changeset viewer.