- Timestamp:
- Nov 19, 2005, 12:35:48 AM (19 years ago)
- Location:
- trunk/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/multi_type.cc
r5642 r5643 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 119 119 this->type = MT_NULL; 120 120 this->storedString = NULL; 121 } 122 123 124 121 this->value.Bool = false; 122 } 123 124 125 /** 126 * sets the type of this MultiType and resets to the default value 127 * @param type the new Type 128 */ 125 129 void MultiType::setType(int type) 126 130 { 127 this->type = (MT_Type)type;128 129 131 if (this->type != type) 130 132 { 133 this->type = (MT_Type)type; 134 131 135 if (this->type == MT_NULL) 132 this->setString(""); 133 134 } 135 /// @todo check if this works... 136 136 this->reset(); 137 } 137 138 } 138 139 … … 348 349 349 350 /** 351 * Resets the MultiType to default values. 352 */ 353 void MultiType::reset() 354 { 355 switch (this->type) 356 { 357 default: 358 break; 359 case MT_BOOL: 360 this->setBool(false); 361 case MT_INT: 362 this->setInt(0); 363 break; 364 case MT_FLOAT: 365 this->setFloat(0.0f); 366 break; 367 case MT_CHAR: 368 this->setChar('\0'); 369 break; 370 case MT_STRING: 371 this->setString(""); 372 break; 373 } 374 } 375 376 /** 350 377 * converts a MT_Type into a String 351 378 * @param type: the MT_Type -
trunk/src/lib/util/multi_type.h
r5642 r5643 69 69 const char* getString(); 70 70 71 void reset(); 71 72 72 73 void debug();
Note: See TracChangeset
for help on using the changeset viewer.