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

    r2105 r2261  
    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    {
    4050        RegisterObject(QuestItem);
    4151
    42         this->initialize();
     52        this->id_ = "";
    4353    }
    4454
     
    5262    }
    5363
     64    /**
     65    @brief
     66        Method for creating a QuestItem object through XML.
     67    */
    5468    void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5569    {
     
    5771
    5872        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);
    6173        XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
    62 
    6374    }
    64 
    6575
    6676    /**
    6777    @brief
    68         Initializes the object.
    69         Should be called first in every constructor of this class.
     78        Sets the id of the QuestItem.
     79    The id must be of GUID form. See 'http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure' for more information.
     80    @param id
     81        The id to be set.
    7082    */
    71     void QuestItem::initialize(void)
    72     {
    73         RegisterObject(QuestItem);
    74 
    75         this->id_ = "";
    76     }
    77 
    7883    void QuestItem::setId(const std::string & id)
    7984    {
    80         if(!isId(id))
     85        if(!isId(id)) //!< Checks whether the id is a valid id.
    8186        {
    8287            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
    8388            return;
    8489        }
     90       
    8591        this->id_ = id;
    8692    }
    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     //}
    9493
    9594    /**
Note: See TracChangeset for help on using the changeset viewer.