Changeset 9684 in orxonox.OLD for branches/new_class_id/src
- Timestamp:
- Aug 22, 2006, 1:34:31 AM (18 years ago)
- Location:
- branches/new_class_id/src
- Files:
-
- 2 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/coord/p_node.cc
r9656 r9684 19 19 20 20 #include "util/loading/load_param.h" 21 #include "class_list.h"22 21 23 22 #include "netdefs.h" … … 38 37 : BaseObject(), Synchronizeable() 39 38 { 40 this-> setClassID(CL_PARENT_NODE, "PNode");39 this->registerObject(this, PNode::_objectList); 41 40 42 41 this->bRelCoorChanged = true; … … 541 540 void PNode::addChild (const std::string& childName) 542 541 { 543 PNode* childNode = dynamic_cast<PNode*>(ClassList::getObject(childName, CL_PARENT_NODE));542 PNode* childNode = PNode::objectList().getObject(childName); 544 543 // PRINTF(0)("Adding the Child: %s to: %s\n", childName, this->getName()); 545 544 // assert( childNode != NULL ); … … 625 624 void PNode::setParent (const std::string& parentName) 626 625 { 627 PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE));626 PNode* parentNode = PNode::objectList().getObject(parentName); 628 627 if (parentNode != NULL) 629 628 parentNode->addChild(this); … … 681 680 void PNode::setParentSoft(const std::string& parentName, float bias) 682 681 { 683 PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE));682 PNode* parentNode = PNode::objectList().getObject(parentName); 684 683 if (parentNode != NULL) 685 684 this->setParentSoft(parentNode, bias); … … 731 730 { 732 731 PNode::nullParent = new PNode(NULL, PNODE_PARENT_MODE_DEFAULT | PNODE_REPARENT_TO_NULL); 733 PNode::nullParent->setClassID(CL_NULL_PARENT, "NullParent");732 //PNode::nullParent->registerObject(, CL_NULL_PARENT); 734 733 PNode::nullParent->setName("NullParent"); 735 734 PNode::nullParent->setSynchronized(true); -
branches/new_class_id/src/lib/coord/p_node.h
r9406 r9684 74 74 //! Patent Node is a Engine to calculate the position of an Object in respect to the position of its parent. 75 75 class PNode : virtual public BaseObject, virtual public Synchronizeable { 76 public: 76 NewObjectListDeclaration(PNode); 77 78 public: 77 79 PNode (PNode* parent = PNode::getNullParent(), long nodeFlags = PNODE_PARENT_MODE_DEFAULT); 78 80 virtual ~PNode (); -
branches/new_class_id/src/lib/graphics/importer/height_map.cc
r8316 r9684 327 327 328 328 329 NewObjectListDefinition(HeightMap); 329 330 330 331 … … 413 414 void HeightMap::init(const std::string& heightMapName) 414 415 { 415 this-> setClassID(CL_HEIGHT_MAP, "HeightMap");416 this->registerObject(this, HeightMap::_objectList); 416 417 417 418 this->shiftX = 0; -
branches/new_class_id/src/lib/graphics/importer/height_map.h
r7526 r9684 29 29 30 30 class SDL_Surface; 31 class Vector;32 31 class Material; 33 class PNode;34 32 class Texture; 35 33 class HeightMap; … … 70 68 71 69 70 72 71 //!< the height map representation itself 73 72 class HeightMap : public VertexArrayModel 74 73 { 74 NewObjectListDeclaration(HeightMap); 75 75 friend class Tile; 76 76 -
branches/new_class_id/src/lib/graphics/importer/interactive_model.cc
r9406 r9684 22 22 23 23 24 NewObjectListDefinition(InteractiveModel); 25 24 26 /** 25 27 * standard constructor … … 28 30 InteractiveModel::InteractiveModel() 29 31 { 30 this-> setClassID(CL_INTERACTIVE_MODEL, "InteractiveModel");32 this->registerObject(this, InteractiveModel::_objectList); 31 33 } 32 34 -
branches/new_class_id/src/lib/graphics/importer/interactive_model.h
r9003 r9684 30 30 class InteractiveModel : public Model 31 31 { 32 NewObjectListDeclaration(InteractiveModel); 32 33 public: 33 34 InteractiveModel(); -
branches/new_class_id/src/lib/graphics/importer/model.cc
r9406 r9684 20 20 #include "glincl.h" 21 21 22 22 NewObjectListDefinition(Model); 23 23 24 24 /** … … 28 28 Model::Model() 29 29 { 30 this-> setClassID(CL_MODEL, "Model");30 this->registerObject(this, Model::_objectList); 31 31 this->pModelInfo.numVertices = 0; 32 32 this->pModelInfo.numTriangles = 0; -
branches/new_class_id/src/lib/graphics/importer/model.h
r8035 r9684 54 54 //! This class defines the basic components of a model 55 55 class Model : virtual public BaseObject { 56 NewObjectListDeclaration(Model); 56 57 57 58 public: -
branches/new_class_id/src/lib/graphics/importer/objModel.cc
r8369 r9684 27 27 #include "compiler.h" 28 28 29 NewObjectListDefinition(OBJModel); 29 30 /** 30 31 * @brief Crates a 3D-Model, loads in a File and scales it. … … 35 36 : StaticModel(fileName) 36 37 { 37 this-> setClassID(CL_OBJ_MODEL, "OBJModel");38 this->registerObject(this, OBJModel::_objectList); 38 39 39 40 this->objPath = "./"; -
branches/new_class_id/src/lib/graphics/importer/objModel.h
r8369 r9684 12 12 class OBJModel : public StaticModel 13 13 { 14 public: 14 NewObjectListDeclaration(OBJModel); 15 public: 15 16 OBJModel(const std::string& fileName, float scaling = 1.0); 16 17 virtual ~OBJModel(); -
branches/new_class_id/src/lib/graphics/importer/static_model.cc
r9406 r9684 129 129 130 130 131 132 131 133 ///////////// 132 134 /// MODEL /// 133 135 ///////////// 136 NewObjectListDefinition(StaticModel); 137 134 138 /** 135 139 * @brief Creates a 3D-Model. … … 139 143 StaticModel::StaticModel(const std::string& modelName) 140 144 { 141 this-> setClassID(CL_STATIC_MODEL, "StaticModel");145 this->registerObject(this, StaticModel::_objectList); 142 146 PRINTF(4)("new 3D-Model is being created\n"); 143 147 this->setName(modelName); -
branches/new_class_id/src/lib/graphics/importer/static_model.h
r7221 r9684 94 94 class StaticModel : public Model 95 95 { 96 public: 96 NewObjectListDeclaration(StaticModel); 97 public: 97 98 StaticModel(const std::string& modelName = ""); 98 99 virtual ~StaticModel(); -
branches/new_class_id/src/lib/graphics/importer/vertex_array_model.cc
r9406 r9684 24 24 25 25 26 NewObjectListDefinition(VertexArrayModel); 26 27 27 28 ///////////// … … 35 36 VertexArrayModel::VertexArrayModel() 36 37 { 37 this-> setClassID(CL_MODEL, "VertexArrayModel");38 this->registerObject(this, VertexArrayModel::_objectList); 38 39 39 40 this->newStripe(); … … 49 50 VertexArrayModel::VertexArrayModel(const Model& model) 50 51 { 51 this-> setClassID(CL_MODEL, "VertexArrayModel");52 this->registerObject(this, VertexArrayModel::_objectList); 52 53 53 54 // importing the data to the new Model. -
branches/new_class_id/src/lib/graphics/importer/vertex_array_model.h
r6769 r9684 27 27 class VertexArrayModel : public Model 28 28 { 29 public: 29 NewObjectListDeclaration(VertexArrayModel); 30 public: 30 31 VertexArrayModel(); 31 32 VertexArrayModel(const Model& model); -
branches/new_class_id/src/lib/lang/Makefile.am
r9677 r9684 9 9 libORXlang_a_SOURCES = \ 10 10 base_object.cc \ 11 class_list.cc \12 11 new_class_id.cc \ 13 12 new_object_list.cc … … 15 14 noinst_HEADERS = \ 16 15 base_object.h \ 17 class_list.h \18 16 new_class_id.h \ 19 17 new_object_list.h -
branches/new_class_id/src/lib/lang/base_object.cc
r9406 r9684 20 20 21 21 #include "util/loading/load_param.h" 22 #include "class_list.h"23 22 24 23 /** … … 28 27 BaseObject::BaseObject(const std::string& objectName) 29 28 { 30 this->classID = CL_BASE_OBJECT;31 29 this->className = "BaseObject"; 32 30 33 31 this->objectName = objectName; 34 this->classList = NULL;35 32 this->xmlElem = NULL; 36 33 … … 43 40 BaseObject::~BaseObject () 44 41 { 45 ClassList::removeFromClassList(this); 42 /// Remove from the NewObjectLists 43 ClassList::iterator it; 44 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 45 { 46 (*it)._objectList->unregisterObject((*it)._iterator); 47 delete (*it)._iterator; 48 } 46 49 47 50 if (this->xmlElem != NULL) … … 69 72 70 73 /** 71 * @brief sets the class identifiers72 * @param id a number for the class from class_id.h enumeration73 * @param className the class name74 */75 void BaseObject::setClassID(ClassID classID, const std::string& className)76 {77 //printf("%s(0x%.8X)->%s(0x%.8X)\n", this->className, this->classID, className, classID);78 assert (!(this->classID & classID & !CL_MASK_SUBSUPER_CLASS_IDA ));79 80 this->leafClassID = classID;81 this->classID |= (long)classID;82 this->className = className;83 84 this->classList = ClassList::addToClassList(this, classID, this->classID, className);85 }86 87 88 /**89 74 * @brief set the name of the Object 90 75 * @param objectName The new name of the Object. … … 97 82 98 83 /** 99 * @brief queries for the ClassID of the Leaf Class (the last made class of this type 100 * @returns the ClassID of the Leaf Class (e.g. the ID of the Class) 101 * 102 * the returned ID can be used to generate new Objects of the same type through 103 * Factory::fabricate(Object->getLeafClassID()); 84 * @brief Seeks in the Inheritance if it matches objectList. 85 * @param objectList The ObjectList this should be a member of (by Pointer-comparison). 86 * @return True if found, false if not. 104 87 */ 105 const ClassID& BaseObject::getLeafClassID() const88 bool BaseObject::isA(const NewObjectListBase& objectList) const 106 89 { 107 return this->leafClassID; 90 ClassList::const_iterator it; 91 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 92 if ((*it)._objectList == &objectList) 93 return true; 94 return false; 108 95 } 109 96 110 97 /** 98 * @brief Seeks in the Inheritance if it matches objectList. 99 * @param classID The ClassID of the class this should be a member of. 100 * @return True if found, false if not. 101 */ 102 bool BaseObject::isA(int classID) const 103 { 104 ClassList::const_iterator it; 105 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 106 if (*(*it)._objectList == classID) 107 return true; 108 return false; 109 } 111 110 112 111 /** 113 * @brief checks if the class is a classID114 * @param class ID the Identifier to check for115 * @return s true if it is, false otherwise116 */117 bool BaseObject::isA (ClassID classID) const112 * @brief Seeks in the Inheritance if it matches objectList. 113 * @param className The ClassName of the class this should be a member of. 114 * @return True if found, false if not. 115 */ 116 bool BaseObject::isA(const std::string& className) const 118 117 { 119 // if classID is a derivable object from a SUPERCLASS 120 if (classID & CL_MASK_SUPER_CLASS) 121 { 122 if( likely(this->classID & classID)) 118 ClassList::const_iterator it; 119 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 120 if (*(*it)._objectList == className) 123 121 return true; 124 }125 // if classID is a SubSuperClass, and126 else if (classID & CL_MASK_SUBSUPER_CLASS)127 {128 if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_IDA) == (classID & CL_MASK_SUBSUPER_CLASS_IDA)) &&129 this->classID & classID & CL_MASK_SUBSUPER_CLASS_IDB))130 return true;131 }132 // if classID is a LOWLEVEL-class133 else134 {135 if( likely((this->classID & CL_MASK_LOWLEVEL_CLASS) == classID))136 return true;137 }138 122 return false; 139 123 } 140 124 141 125 126 void BaseObject::listInheritance() const 127 { 128 PRINT(0)("Listing inheritance diagram for ....: "); 129 ClassList::const_iterator it; 130 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 131 PRINT(0)(" -> %s(id:%d)", (*it)._objectList->name().c_str(), (*it)._objectList->id()); 132 PRINT(0)("\n"); 142 133 143 /**144 * @brief checks if the class is a classID145 * @param classID the Identifier to check for146 * @returns true if it is, false otherwise147 */148 bool BaseObject::isA (const std::string& className) const149 {150 ClassID classID = ClassList::StringToID(className);151 if (classID != CL_NULL)152 return this->isA(classID);153 else154 return false;155 134 } 156 157 158 /**159 * @brief compares the ObjectName with an external name160 * @param objectName: the name to check.161 * @returns true on match, false otherwise.162 */163 bool BaseObject::operator==(const std::string& objectName) const164 {165 return (this->objectName == objectName);166 }167 -
branches/new_class_id/src/lib/lang/base_object.h
r9406 r9684 14 14 #define __BASE_OBJECT_H_ 15 15 16 #include " class_id.h"16 #include "new_object_list.h" 17 17 #include "sigslot/slot.h" 18 18 … … 41 41 inline TiXmlNode* getXmlElem() const { return this->xmlElem; }; 42 42 43 / ** @returns the className of the corresponding Object */44 inline const std::string& getClassName() const { return this->className; }43 // /** @returns the className of the corresponding Object */ 44 //inline const std::string& getClassName() const { return this->className; } 45 45 /** @returns the className of the corresponding Object as a C-compliant string (const char*) */ 46 46 inline const char* getClassCName() const { return this->className.c_str(); }; 47 /** @returns the classID of the corresponding Object */ 48 inline int getClassID() const { return this->classID; }; 49 const ClassID& getLeafClassID() const; 47 /** @returns the ClassName of the Topmost Object of the ClassStack */ 48 inline const std::string& getClassName() const { return _classes.front()._objectList->name(); } 50 49 51 bool isA (ClassID classID) const; 52 bool isA (const std::string& className) const; 50 /** @returns the ID of the Topmost object of the ClassStack */ 51 inline int getLeafClassID() const { return _classes.front()._objectList->id(); } 52 53 bool isA(const NewObjectListBase& objectList) const; 54 bool isA(int classID) const; 55 bool isA(const std::string& className) const; 56 57 void listInheritance() const; 53 58 54 59 /** @param classID comparer for a ClassID @returns true on match, false otherwise */ 55 bool operator==(ClassID classID) const { return this->isA(classID); }; 56 bool operator==(const std::string& objectName) const; 60 bool operator==(int classID) const { return this->isA(classID); }; 61 /** @param objectName: the name to check. * @returns true on match, false otherwise. */ 62 bool operator==(const std::string& objectName) const { return this->objectName == objectName;}; 57 63 58 64 protected: 59 void setClassID(ClassID classID, const std::string& className);65 template<class T> void registerObject(T* object, NewObjectList<T>& list); 60 66 61 67 protected: … … 63 69 64 70 private: 65 std::string className; //!< the name of the class66 long classID; //!< this is the id from the class_id.h enumeration67 ClassID leafClassID; //!< The Leaf Class ID68 69 ClassList* classList; //!< Pointer to the ClassList this Object is inside of70 71 71 72 TiXmlNode* xmlElem; //!< The XML Element with wich this Object was loaded(saved). 73 74 ////////////////////////////// 75 //// Type Definition Part //// 76 ////////////////////////////// 77 //! A ClassEntry so we can store Classes inside of Objects 78 struct ClassEntry 79 { 80 /** Simple Constuctor @param objectList the NewObjectList, @param iterator the (intrusive) Iterator inside of the ObjectList */ 81 inline ClassEntry (NewObjectListBase* objectList, NewObjectListBase::IteratorBase* iterator) : _objectList(objectList), _iterator(iterator) {} 82 NewObjectListBase* _objectList; //!< A ObjectList this Object is part of 83 NewObjectListBase::IteratorBase* _iterator; //!< An iterator pointing to the position of the Object inside of the List. 84 }; 85 typedef std::list<ClassEntry> ClassList; //!< Type definition for the List. 86 87 std::string className; //!< the name of the class 88 ClassList _classes; //!< All Classes this object is part of. 89 72 90 }; 73 91 92 93 /** 94 * @brief Registeres an Object of Type T to objectList 95 * @param object The Object to append to the objectList. 96 * @param objectList The ObjectList to append the Object to. 97 * 98 * This function is essential to integrate objects into their designated ObjectList. 99 * Remember if you do not want objects to be stored in Lists (less overhead), 100 * do not attempt to call this function. 101 */ 102 template<class T> 103 inline void BaseObject::registerObject(T* object, NewObjectList<T>& objectList) 104 { 105 this->_classes.push_front(ClassEntry(&objectList, objectList.registerObject(object))); 106 } 107 74 108 #endif /* __BASE_OBJECT_H_ */ -
branches/new_class_id/src/lib/lang/new_object_list.h
r9682 r9684 16 16 17 17 #define NewObjectListDeclaration(ClassName) \ 18 static NewObjectList<ClassName> objectList 18 public: \ 19 static const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \ 20 private: \ 21 static NewObjectList<ClassName> _objectList 19 22 20 23 #define NewObjectListDefinitionID(ClassName, ID) \ 21 NewObjectList<ClassName> ClassName:: objectList(#ClassName, ID)24 NewObjectList<ClassName> ClassName::_objectList(#ClassName, ID) 22 25 23 26 … … 157 160 T* NewObjectList<T>::getObject(const std::string& name) const 158 161 { 159 iterator it = std::find(this->_objects.begin(), this->_objects.end(), name);160 if (it != this->_objects.end())161 return *it;162 else163 162 const_iterator it; 163 for (it = this->_objects.begin(); it != this->_objects.end(); ++it) 164 if ((*it)->getName() == name) 165 return (*it); 166 return NULL; 164 167 } 165 168 -
branches/new_class_id/src/lib/util/executor/executor.cc
r8894 r9684 18 18 #include "executor.h" 19 19 20 //////////////////////// 21 // SHELL COMMAND BASE // 22 //////////////////////// 20 21 NewObjectListDefinition(Executor); 22 23 23 /** 24 24 * @brief constructs and registers a new Command … … 35 35 const MultiType& param6) 36 36 { 37 this-> setClassID(CL_EXECUTOR, "Executor");37 this->registerObject(this, Executor::_objectList); 38 38 39 39 // What Parameters have we got -
branches/new_class_id/src/lib/util/executor/executor.h
r8894 r9684 38 38 class Executor : public BaseObject 39 39 { 40 NewObjectListDeclaration(Executor); 40 41 public: 41 42 virtual ~Executor(); -
branches/new_class_id/src/lib/util/loading/dynamic_loader.cc
r9406 r9684 24 24 25 25 26 26 NewObjectListDefinition(DynamicLoader); 27 27 28 28 /** … … 31 31 */ 32 32 DynamicLoader::DynamicLoader (const std::string& libName) 33 : Factory(NULL, CL_NULL)33 : Factory(NULL, 0) 34 34 { 35 this-> setClassID(CL_DYNAMIC_LOADER, "DynamicLoader");35 this->registerObject(this, DynamicLoader::_objectList); 36 36 37 37 this->handle = NULL; -
branches/new_class_id/src/lib/util/loading/dynamic_loader.h
r7193 r9684 19 19 class DynamicLoader : public Factory 20 20 { 21 NewObjectListDeclaration(DynamicLoader); 21 22 22 23 public: -
branches/new_class_id/src/lib/util/loading/factory.cc
r9675 r9684 19 19 //#include "shell_command.h" 20 20 21 21 NewObjectListDefinition(Factory); 22 22 23 23 //SHELL_COMMAND(create, Factory, fabricate); … … 28 28 * set everything to zero and define factoryName 29 29 */ 30 Factory::Factory (const std::string& factoryName, ClassIDclassID)30 Factory::Factory (const std::string& factoryName, int classID) 31 31 : classID(classID), className(factoryName) 32 32 { 33 this-> setClassID(CL_FACTORY, "Factory");33 this->registerObject(this, Factory::_objectList); 34 34 this->setName(factoryName); 35 35 … … 74 74 * @returns true on match, false otherwise 75 75 */ 76 bool Factory::operator==( ClassIDclassID) const76 bool Factory::operator==(int classID) const 77 77 { 78 78 return (this->classID == classID); … … 149 149 * @returns a new Object of Type classID on match, NULL otherwise 150 150 */ 151 BaseObject* Factory::fabricate( ClassIDclassID)151 BaseObject* Factory::fabricate(int classID) 152 152 { 153 153 if (Factory::factoryList == NULL) -
branches/new_class_id/src/lib/util/loading/factory.h
r8148 r9684 38 38 39 39 //! The Factory is a loadable object handler 40 class Factory : public BaseObject { 41 42 public: 40 class Factory : public BaseObject 41 { 42 NewObjectListDeclaration(Factory); 43 public: 43 44 virtual ~Factory (); 44 45 … … 46 47 47 48 static BaseObject* fabricate(const std::string& className); 48 static BaseObject* fabricate( ClassIDclassID);49 static BaseObject* fabricate(int classID); 49 50 static BaseObject* fabricate(const TiXmlElement* root = NULL); 50 51 51 52 52 bool operator==( ClassIDclassID) const;53 bool operator==(int classID) const; 53 54 bool operator==(const char* className) const; 54 55 bool operator==(const std::string& className) const; 55 56 56 57 Factory (const std::string& factoryName, ClassIDclassID);58 57 protected: 58 Factory (const std::string& factoryName, int classID); 59 virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const = 0; 59 60 60 61 const ClassIDclassID; //!< The Class-Identifyer of the Factory.62 63 61 protected: 62 const int classID; //!< The Class-Identifyer of the Factory. 63 const std::string className; //!< The name of the Class. 64 static std::list<Factory*>* factoryList; //!< List of Registered Factories 64 65 }; 65 66 … … 70 71 template<class T> class tFactory : public Factory 71 72 { 72 73 /**74 * @brief creates a new type Factory to enable the loading of T75 * @param factoryName the Name of the Factory to load.76 * @param classID the ID of the Class to be created.77 */78 tFactory (const char* factoryName, ClassIDclassID)79 : Factory(factoryName, classID)73 public: 74 /** 75 * @brief creates a new type Factory to enable the loading of T 76 * @param factoryName the Name of the Factory to load. 77 * @param classID the ID of the Class to be created. 78 */ 79 tFactory (const char* factoryName, int classID) 80 : Factory(factoryName, classID) 80 81 { } 81 82 82 83 84 85 86 87 88 89 90 91 83 private: 84 /** 85 * @brief fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*) 86 * @param root the TiXmlElement T should load parameters from. 87 * @return the newly fabricated T. 88 */ 89 virtual BaseObject* fabricateObject(const TiXmlElement* root = NULL) const 90 { 91 return new T(root); 92 } 92 93 }; 93 94 -
branches/new_class_id/src/lib/util/loading/game_loader.cc
r9110 r9684 28 28 #include "key_mapper.h" 29 29 30 NewObjectListDefinition(GameLoader); 30 31 31 32 … … 43 44 GameLoader::GameLoader () 44 45 { 45 this-> setClassID(CL_GAME_LOADER, "GameLoader");46 this->registerObject(this, GameLoader::_objectList); 46 47 this->setName("GameLoader"); 47 48 this->bRun = true; … … 57 58 delete this->currentCampaign; 58 59 this->currentCampaign = NULL; 59 60 60 61 GameLoader::singletonRef = NULL; 61 62 } -
branches/new_class_id/src/lib/util/loading/game_loader.h
r7868 r9684 38 38 class GameLoader : public EventListener 39 39 { 40 public: 40 NewObjectListDeclaration(GameLoader); 41 public: 41 42 virtual ~GameLoader (); 42 43 /** this class is a singleton class @returns an instance of itself */ -
branches/new_class_id/src/lib/util/loading/resource_manager.cc
r9406 r9684 50 50 #include <unistd.h> 51 51 52 52 NewObjectListDefinition(ResourceManager); 53 53 54 54 /** … … 57 57 ResourceManager::ResourceManager () 58 58 { 59 this-> setClassID(CL_RESOURCE_MANAGER, "ResourceManager");59 this->registerObject(this, ResourceManager::_objectList); 60 60 this->setName("ResourceManager"); 61 61 -
branches/new_class_id/src/lib/util/loading/resource_manager.h
r8724 r9684 94 94 class ResourceManager : public BaseObject 95 95 { 96 public: 96 NewObjectListDeclaration(ResourceManager); 97 public: 97 98 virtual ~ResourceManager(); 98 99 /** @returns a Pointer to the only object of this Class */ … … 101 102 bool setDataDir(const std::string& dataDir); 102 103 /** @returns the Name of the data directory */ 103 104 inline const std::string& getDataDir() const { return this->dataDir; }; 104 105 105 106 … … 139 140 static ResourceType stringToResourceType(const std::string& resourceType); 140 141 141 142 private: 142 143 ResourceManager(); 143 144 Resource* loadResource(const std::string& fileName, ResourceType type, ResourcePriority prio, 144 145 const MultiType& param0, const MultiType& param1, const MultiType& param2); 145 146 146 147 private: 147 148 static ResourceManager* singletonRef; //!< singleton Reference 148 149 -
branches/new_class_id/src/lib/util/preferences.cc
r8362 r9684 20 20 #include "debug.h" 21 21 22 NewObjectListDefinition(Preferences); 22 23 23 24 /** … … 26 27 Preferences::Preferences () 27 28 { 28 this->setClassID(CL_PREFERENCES, "Preferences");29 this->registerObject(this, Preferences::_objectList); 29 30 this->setName("Preferences"); 30 31 this->fileName = ""; -
branches/new_class_id/src/lib/util/preferences.h
r8362 r9684 29 29 //! A default singleton class. 30 30 class Preferences : public BaseObject { 31 31 NewObjectListDeclaration(Preferences); 32 32 public: 33 33 virtual ~Preferences(void); -
branches/new_class_id/src/world_entities/weapons/ammo_container.h
r6671 r9684 22 22 virtual ~AmmoContainer(); 23 23 24 bool operator=( ClassIDprojectileType) const { return (this->projectileType == projectileType); };24 bool operator=(int projectileType) const { return (this->projectileType == projectileType); }; 25 25 ClassID getProjectileType() const { return this->projectileType; }; 26 26
Note: See TracChangeset
for help on using the changeset viewer.