Changeset 5536 in orxonox.OLD for trunk/src/lib/util/multi_type.cc
- Timestamp:
- Nov 10, 2005, 10:52:34 PM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/multi_type.cc
r5529 r5536 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include "proto_class.h" 18 #include "multi_type.h" 19 #include "stdincl.h" 19 20 20 21 using namespace std; 21 22 22 23 /** 24 * standard constructor 25 * @todo this constructor is not jet implemented - do it 26 */ 27 ProtoClass::ProtoClass () 23 MultiType::MultiType(int value) 28 24 { 29 this->setClassID(CL_PROTO_ID, "ProtoClass"); 30 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 36 Advanced Topics: 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 the object_manager.h header comments. You will use this most certanly only if you 39 make many objects of your class, like a weapon bullet. 40 */ 25 this->type = M_Int; 26 this->value.typeInt = value; 41 27 } 42 28 29 30 MultiType::MultiType(float value) 31 { 32 this->type = M_Float; 33 this->value.typeFloat = value; 34 } 35 36 37 MultiType::MultiType(char value) 38 { 39 this->type = M_Char; 40 this->value.typeChar = value; 41 } 42 43 44 MultiType::MultiType(const char* value) 45 { 46 this->type = M_String; 47 this->value.typeString = new char[strlen(value)+1]; 48 strcpy(this->value.typeString, value); 49 } 43 50 44 51 /** 45 52 * standard deconstructor 46 53 */ 47 ProtoClass::~ProtoClass()54 MultiType::~MultiType () 48 55 { 49 56 // delete what has to be deleted here
Note: See TracChangeset
for help on using the changeset viewer.