- Timestamp:
- Jun 30, 2005, 4:53:14 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/base_object.cc
r4742 r4744 63 63 /** 64 64 \brief sets the class identifiers 65 \param id a number for the class from class_ list.h enumeration65 \param id a number for the class from class_id.h enumeration 66 66 \param className the class name 67 67 */ -
orxonox/trunk/src/lib/lang/base_object.h
r4742 r4744 49 49 50 50 private: 51 static void addToClassList(BaseObject* object, ClassID id, const char* className);52 53 private:54 51 const char* className; //!< the name of the class 55 long classID; //!< this is the id from the class_ list.h enumeration52 long classID; //!< this is the id from the class_id.h enumeration 56 53 char* objectName; //!< The name of this object 57 54 58 55 bool finalized; //!< is true if the object is ready to be garbage collected 59 60 // static ClassList* classList;61 56 }; 62 57 -
orxonox/trunk/src/lib/lang/class_list.cc
r4743 r4744 30 30 don't forget to: 31 31 1. Add the new file new_class.cc to the ./src/Makefile.am 32 2. Add the class identifier to ./src/class_ list.h eg. CL_NEW_CLASS32 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 33 33 34 34 Advanced Topics: -
orxonox/trunk/src/lib/lang/class_list.h
r4743 r4744 8 8 #define _CLASS_LIST_H 9 9 10 #include "class_id.h" 11 10 12 // FORWARD DEFINITION 11 13 class BaseObject; 14 template<class T> class tList; 12 15 13 16 … … 20 23 21 24 25 void addToClassList(BaseObject* objectPointer, ClassID classID, const char* className); 22 26 private: 27 static ClassList* first; 28 static ClassList* last; 29 30 int classCount; 31 23 32 24 33 }; -
orxonox/trunk/src/proto/proto_class.cc
r4320 r4744 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 ProtoClass::ProtoClass () 27 ProtoClass::ProtoClass () 28 28 { 29 this->setClassID(CL_PROTO_ID, "ProtoClass"); 29 this->setClassID(CL_PROTO_ID, "ProtoClass"); 30 30 31 31 /* If you make a new class, what is most probably the case when you write this file 32 32 don't forget to: 33 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_ list.h eg. CL_NEW_CLASS34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 35 36 36 Advanced Topics: 37 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 38 the object_manager.h header comments. You will use this most certanly only if you 39 39 make many objects of your class, like a weapon bullet. 40 40 */ 41 41 } … … 46 46 47 47 */ 48 ProtoClass::~ProtoClass () 48 ProtoClass::~ProtoClass () 49 49 { 50 50 // delete what has to be deleted here -
orxonox/trunk/src/proto/proto_singleton.cc
r4519 r4744 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 24 24 \brief standard constructor 25 25 */ 26 ProtoSingleton::ProtoSingleton () 26 ProtoSingleton::ProtoSingleton () 27 27 { 28 28 this->setClassName("ProtoSingleton"); 29 this->setClassID(CL_PROTO_ID, "ProtoSingleton"); 29 this->setClassID(CL_PROTO_ID, "ProtoSingleton"); 30 30 31 31 /* If you make a new class, what is most probably the case when you write this file 32 32 don't forget to: 33 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_ list.h eg. CL_NEW_CLASS34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 35 36 36 Advanced Topics: 37 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 38 the object_manager.h header comments. You will use this most certanly only if you 39 39 make many objects of your class, like a weapon bullet. 40 40 */ 41 41 } … … 50 50 51 51 */ 52 ProtoSingleton::~ProtoSingleton () 52 ProtoSingleton::~ProtoSingleton () 53 53 { 54 54 ProtoSingleton::singletonRef = NULL; -
orxonox/trunk/src/util/object_manager.h
r4699 r4744 11 11 TO ADD SUPPORT FOR A CLASS do the following steps: 12 12 1. include the hader file : #include "class_header.h" 13 2. add the class to the type enum class List {}; in class_list.h13 2. add the class to the type enum classID {}; in class_id.h 14 14 3. define a function void mCache( ClassName ) in class ObjectManager 15 15 … … 23 23 #include "projectile.h" 24 24 #include "list.h" 25 26 #include "class_list.h"27 28 25 29 26 class GarbageCollector;
Note: See TracChangeset
for help on using the changeset viewer.