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/QuestItem.cc

    r2105 r2146  
    2626 *
    2727 */
     28 
     29/**
     30    @file QuestItem.cc
     31    @brief
     32        Implementation of the QuestItem class.
     33*/
    2834
    2935#include "OrxonoxStableHeaders.h"
     
    3642namespace orxonox {
    3743
     44    /**
     45    @brief
     46        Constructor. Registers and initializes the object.
     47    */
    3848    QuestItem::QuestItem(BaseObject* creator) : BaseObject(creator)
    3949    {
     
    4252        this->initialize();
    4353    }
    44 
    45     /**
    46     @brief
    47         Destructor.
    48     */
    49     QuestItem::~QuestItem()
    50     {
    51 
    52     }
    53 
    54     void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    55     {
    56         SUPER(QuestItem, XMLPort, xmlelement, mode);
    57 
    58         XMLPortParam(QuestItem, "id", setId, getId, xmlelement, mode);
    59         //Doesn't getDescription have to be of type getDescription(unsigned int) ?
    60         //XMLPortObjectTemplate(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode, unsigned int);
    61         XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
    62 
    63     }
    64 
    65 
     54   
    6655    /**
    6756    @brief
     
    7665    }
    7766
     67    /**
     68    @brief
     69        Destructor.
     70    */
     71    QuestItem::~QuestItem()
     72    {
     73
     74    }
     75
     76    /**
     77    @brief
     78        Method for creating a QuestItem object through XML.
     79    */
     80    void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     81    {
     82        SUPER(QuestItem, XMLPort, xmlelement, mode);
     83
     84        XMLPortParam(QuestItem, "id", setId, getId, xmlelement, mode);
     85        XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
     86    }
     87
     88    /**
     89    @brief
     90        Sets the id of the QuestItem.
     91        The id must be of GUID form. See 'http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure' for more information.
     92    @param id
     93        The id to be set.
     94    */
    7895    void QuestItem::setId(const std::string & id)
    7996    {
    80         if(!isId(id))
     97        if(!isId(id)) //!< Checks whether the id is a valid id.
    8198        {
    8299            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
    83100            return;
    84101        }
     102       
    85103        this->id_ = id;
    86104    }
    87 
    88     //const QuestDescription* QuestItem::getDescription(unsigned int index) const //!< Returns the description of the QuestItem.
    89     //{
    90     //    if(index != 0)
    91     //        return NULL;
    92     //    return this->description_;
    93     //}
    94105
    95106    /**
Note: See TracChangeset for help on using the changeset viewer.