- Timestamp:
- Oct 30, 2008, 9:52:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/QuestItem.cc
r2021 r2068 37 37 QuestItem::QuestItem() : BaseObject() 38 38 { 39 39 this->initialize(); 40 40 } 41 41 … … 45 45 @param id 46 46 The unique identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure 47 @param title48 The title of this QuestItem. Has an empty string as default.49 @param description50 The description of this QuestItem. Has an empty string as default.51 47 */ 52 QuestItem::QuestItem(std::string id , std::string title, std::string description) : BaseObject()48 QuestItem::QuestItem(std::string id) : BaseObject() 53 49 { 54 50 this->initialize(); 55 51 56 52 this->id_ = id; 57 this->description_ = QuestDescription(title, description);58 53 } 59 54 … … 66 61 67 62 } 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 68 75 69 76 /** … … 78 85 this->id_ = ""; 79 86 } 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 } 80 109 81 110 }
Note: See TracChangeset
for help on using the changeset viewer.