Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2008, 9:52:12 AM (16 years ago)
Author:
dafrick
Message:

Started with XMLPort…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem/src/orxonox/objects/QuestItem.cc

    r2021 r2068  
    3737    QuestItem::QuestItem() : BaseObject()
    3838    {
    39        
     39        this->initialize();
    4040    }
    4141   
     
    4545    @param id
    4646        The unique identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
    47     @param title
    48         The title of this QuestItem. Has an empty string as default.
    49     @param description
    50         The description of this QuestItem. Has an empty string as default.
    5147    */
    52     QuestItem::QuestItem(std::string id, std::string title, std::string description) : BaseObject()
     48    QuestItem::QuestItem(std::string id) : BaseObject()
    5349    {
    5450        this->initialize();
    5551       
    5652        this->id_ = id;
    57         this->description_ = QuestDescription(title, description);
    5853    }
    5954   
     
    6661       
    6762    }
     63   
     64    void QuestItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     65    {
     66        SUPER(QuestItem, XMLPort, xmlelement, mode);
     67       
     68        XMLPortParam(QuestItem, "id", setId, getId, xmlelement, mode);
     69        //Doesn't getDescription have to be of type getDescription(unsigned int) ?
     70        //XMLPortObjectTemplate(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode, unsigned int);
     71        XMLPortObject(QuestItem, QuestDescription, "", setDescription, getDescription, xmlelement, mode);
     72
     73    }
     74
    6875   
    6976    /**
     
    7885        this->id_ = "";
    7986    }
     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    //}
     94   
     95    /**
     96    @brief
     97        Checks whether an input id is of the required form.
     98    @param id
     99        The id to be checked.
     100    @return
     101        Returns true if the string is likely to be of the required form.
     102    @todo
     103        Clarify form, more vigorous checks.
     104    */
     105    bool QuestItem::isId(const std::string & id)
     106    {
     107        return id.size() >= 32;
     108    }
    80109
    81110}
Note: See TracChangeset for help on using the changeset viewer.