Changeset 9667
- Timestamp:
- Aug 25, 2013, 9:08:42 PM (11 years ago)
- Location:
- code/trunk
- Files:
-
- 25 deleted
- 588 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core6 merged: 9552-9554,9556-9574,9577-9579,9585-9593,9596-9612,9626-9662
- Property svn:mergeinfo changed
-
code/trunk/src/SourceConfig.cmake
r9550 r9667 99 99 # All includes in "externals" should be prefixed with the path 100 100 # relative to "external" to avoid conflicts 101 ${CMAKE_CURRENT_SOURCE_DIR}/external101 ../src/external 102 102 # Include directories needed even if only included by Orxonox 103 ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet104 ${CMAKE_CURRENT_SOURCE_DIR}/external/ois103 ../src/external/bullet 104 ../src/external/ois 105 105 106 106 # External -
code/trunk/src/libraries/core/BaseObject.cc
r8858 r9667 39 39 #include "Event.h" 40 40 #include "EventIncludes.h" 41 #include "Iterator.h"42 41 #include "Template.h" 43 42 #include "XMLFile.h" … … 45 44 #include "XMLPort.h" 46 45 #include "command/Functor.h" 46 #include "object/Iterator.h" 47 48 #include "class/OrxonoxInterface.h" // we include this only to include OrxonoxInterface.h at least once in core to keep MSVC happy... 47 49 48 50 namespace orxonox 49 51 { 50 CreateFactory(BaseObject);52 RegisterClass(BaseObject); 51 53 52 54 /** 53 55 @brief Constructor: Registers the object in the BaseObject-list. 54 56 */ 55 BaseObject::BaseObject( BaseObject* creator) : bInitialized_(false)56 { 57 Register RootObject(BaseObject);57 BaseObject::BaseObject(Context* context) : bInitialized_(false) 58 { 59 RegisterObject(BaseObject); 58 60 59 61 this->bInitialized_ = true; … … 68 70 this->mainStateFunctor_ = 0; 69 71 72 if (context) 73 this->setContext(context); 74 75 BaseObject* creator = orxonox_cast<BaseObject*>(context); 70 76 this->setCreator(creator); 71 77 if (this->creator_) … … 199 205 { 200 206 this->networkTemplateNames_.insert(temp->getLink()); 201 207 202 208 Template* link; 203 209 assert(!(link = Template::getTemplate(temp->getLink())) || !link->isLink()); -
code/trunk/src/libraries/core/BaseObject.h
r7401 r9667 49 49 50 50 #include "util/mbool.h" 51 #include " OrxonoxClass.h"52 #include " Super.h"53 #include " SmartPtr.h"51 #include "class/OrxonoxClass.h" 52 #include "class/Super.h" 53 #include "object/SmartPtr.h" 54 54 55 55 namespace orxonox … … 60 60 61 61 /// The BaseObject is the parent of all classes representing an instance in the game. 62 class _CoreExport BaseObject : virtualpublic OrxonoxClass62 class _CoreExport BaseObject : public OrxonoxClass 63 63 { 64 64 template <class T> friend class XMLPortClassParamContainer; 65 65 66 66 public: 67 BaseObject( BaseObject* creator);67 BaseObject(Context* context); 68 68 virtual ~BaseObject(); 69 69 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/libraries/core/CMakeLists.txt
r8858 r9667 22 22 #BUILD_UNIT CoreStableBuildUnit.cc 23 23 ClassTreeMask.cc 24 CommandLineParser.cc25 ConfigValueContainer.cc26 24 DynLib.cc 27 25 DynLibManager.cc … … 30 28 GameMode.cc 31 29 GameState.cc 32 Identifier.cc33 30 Language.cc 34 31 Loader.cc 35 32 LuaState.cc 36 MetaObjectList.cc37 33 Namespace.cc 38 34 NamespaceNode.cc 39 ObjectListBase.cc40 OrxonoxClass.cc41 35 Template.cc 42 36 ViewportEventListener.cc … … 57 51 BUILD_UNIT FilesystemBuildUnit.cc 58 52 command/ArgumentCompletionFunctions.cc 59 ConfigFileManager.cc53 config/ConfigFile.cc 60 54 PathConfig.cc 61 55 END_BUILD_UNIT … … 68 62 ) 69 63 64 ADD_SUBDIRECTORY(class) 70 65 ADD_SUBDIRECTORY(command) 66 ADD_SUBDIRECTORY(config) 71 67 ADD_SUBDIRECTORY(input) 68 ADD_SUBDIRECTORY(object) 72 69 73 70 ORXONOX_ADD_LIBRARY(core … … 75 72 TOLUA_FILES 76 73 command/CommandExecutor.h 77 ConfigFileManager.h74 config/SettingsConfigFile.h 78 75 Game.h 79 76 GameMode.h -
code/trunk/src/libraries/core/ClassTreeMask.cc
r7401 r9667 33 33 34 34 #include "ClassTreeMask.h" 35 #include " Identifier.h"35 #include "class/Identifier.h" 36 36 37 37 namespace orxonox … … 849 849 // If there is a first subclass, move the object-iterator to the first object of this class. Else go to the end 850 850 if (this->subclassIterator_ != this->subclasses_.end()) 851 this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();851 this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin(); 852 852 else 853 853 this->objectIterator_ = ObjectList<BaseObject>::end(); … … 881 881 // Check if there really is a next class. If yes, move the object-iterator to the first object 882 882 if (this->subclassIterator_ != this->subclasses_.end()) 883 this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();883 this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin(); 884 884 else 885 885 return (*this); -
code/trunk/src/libraries/core/ClassTreeMask.h
r7401 r9667 73 73 #include <stack> 74 74 #include "BaseObject.h" 75 #include " Iterator.h"75 #include "object/Iterator.h" 76 76 77 77 namespace orxonox -
code/trunk/src/libraries/core/Core.cc
r9550 r9667 60 60 #include "util/SignalHandler.h" 61 61 #include "PathConfig.h" 62 #include " CommandLineParser.h"63 #include " ConfigFileManager.h"64 #include " ConfigValueIncludes.h"62 #include "config/CommandLineParser.h" 63 #include "config/ConfigFileManager.h" 64 #include "config/ConfigValueIncludes.h" 65 65 #include "CoreIncludes.h" 66 66 #include "DynLibManager.h" … … 68 68 #include "GraphicsManager.h" 69 69 #include "GUIManager.h" 70 #include " Identifier.h"70 #include "class/Identifier.h" 71 71 #include "Language.h" 72 72 #include "LuaState.h" 73 #include "ObjectList.h"74 73 #include "command/ConsoleCommand.h" 75 74 #include "command/IOConsole.h" … … 77 76 #include "command/TclThreadManager.h" 78 77 #include "input/InputManager.h" 78 #include "object/ObjectList.h" 79 79 80 80 namespace orxonox … … 91 91 SetCommandLineArgument(limitToCPU, 0).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is off = 0."); 92 92 #endif 93 94 // register Core as an abstract class to avoid problems if the class hierarchy is created within Core-constructor 95 RegisterAbstractClass(Core).inheritsFrom(Class(Configurable)); 93 96 94 97 Core::Core(const std::string& cmdLine) … … 176 179 // Do this soon after the ConfigFileManager has been created to open up the 177 180 // possibility to configure everything below here 178 Register RootObject(Core);181 RegisterObject(Core); 179 182 orxout(internal_info) << "configuring Core" << endl; 180 183 this->setConfigValues(); … … 198 201 // creates the class hierarchy for all classes with factories 199 202 orxout(internal_info) << "creating class hierarchy" << endl; 200 Identifier ::createClassHierarchy();203 IdentifierManager::getInstance().createClassHierarchy(); 201 204 202 205 // Load OGRE excluding the renderer and the render window … … 248 251 safeObjectDelete(&configFileManager_); 249 252 ConsoleCommand::destroyAll(); 250 Identifier::destroyAllIdentifiers(); 253 Context::setRootContext(NULL); 254 IdentifierManager::getInstance().destroyAllIdentifiers(); 251 255 safeObjectDelete(&signalHandler_); 252 256 safeObjectDelete(&dynLibManager_); … … 508 512 509 513 514 RegisterAbstractClass(DevModeListener).inheritsFrom(Class(Listable)); 515 510 516 DevModeListener::DevModeListener() 511 517 { 512 Register RootObject(DevModeListener);518 RegisterObject(DevModeListener); 513 519 } 514 520 } -
code/trunk/src/libraries/core/Core.h
r8858 r9667 47 47 #include "util/DestructionHelper.h" 48 48 #include "util/Singleton.h" 49 #include " OrxonoxClass.h"49 #include "config/Configurable.h" 50 50 51 51 namespace orxonox 52 52 { 53 53 //! Informs about changes in the Development Mode. 54 class DevModeListener : virtual public OrxonoxClass54 class DevModeListener : virtual public Listable 55 55 { 56 56 public: … … 66 66 You should only create this singleton once because it destroys the identifiers! 67 67 */ 68 class _CoreExport Core : public Singleton<Core>, public OrxonoxClass68 class _CoreExport Core : public Singleton<Core>, public Configurable 69 69 { 70 70 friend class Singleton<Core>; -
code/trunk/src/libraries/core/CoreIncludes.h
r8858 r9667 28 28 29 29 /** 30 @defgroup Factory RegisterObject() and CreateFactory()30 @defgroup Factory RegisterObject() and RegisterClass() 31 31 @ingroup Object 32 32 */ … … 35 35 @file 36 36 @ingroup Object Factory Class Identifier 37 @brief Defines several very important macros used to register objects, create factories, and to work with identifiers. 38 39 Every class needs the @c RegisterObject(class) macro in its constructor. If the class is an interface 40 or the @c BaseObject itself, it needs the macro @c RegisterRootObject(class) instead. 41 42 To allow the object being created through the factory, use the @c CreateFactory(class) macro outside 43 of the class implementation, so it gets executed statically before @c main(). This will at the same time 44 register @a class in the class-hierarchy. If you don't want @a class to be loadable, but still 45 register it, call @c CreateUnloadableFactory(class). 37 @brief Defines several very important macros used to register objects, register classes, and to work with identifiers. 38 39 Every class needs the @c RegisterObject(class) macro in its constructor. 40 41 To register @a class in the class-hierarchy, use the @c RegisterClass(class) macro outside of the class implementation, 42 so it gets executed statically before @c main(). If you don't want @a class to be loadable, but still register it, call 43 @c RegisterUnloadableClass(class). 44 45 Abstract classes are registered with @c RegisterAbstractClass(class). For abstract classes, the inheritance must be 46 defined manually with @c RegisterAbstractClass(class).inheritsFrom(Class(parent)). Multiple parent classes can be defined 47 by chaining the above command. 46 48 47 49 Example: 48 50 @code 49 // Create the factory for MyClass50 CreateFactory(MyClass);51 // register MyClass 52 RegisterClass(MyClass); 51 53 52 54 // Constructor: … … 79 81 80 82 #include "util/Output.h" 81 #include "Identifier.h" 82 #include "ClassFactory.h" 83 #include "ObjectList.h" 84 85 86 /** 87 @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject. 88 @param ClassName The name of the class 89 @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass 90 */ 91 #define InternRegisterObject(ClassName, bRootClass) \ 92 if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initialiseObject(this, #ClassName, bRootClass)) \ 83 #include "class/IdentifierManager.h" 84 #include "object/ClassFactory.h" 85 #include "object/ObjectList.h" 86 87 // resolve macro conflict on windows 88 #if defined(ORXONOX_PLATFORM_WINDOWS) 89 # include <windows.h> 90 # undef RegisterClass 91 #endif 92 93 94 /** 95 @brief Registers the class in the framework. 96 @param ClassName The name of the class 97 */ 98 #define RegisterClass(ClassName) \ 99 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), true) 100 101 /** 102 @brief Registers the class in the framework (for classes without arguments in their constructor). 103 @param ClassName The name of the class 104 */ 105 #define RegisterClassNoArgs(ClassName) \ 106 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryNoArgs<ClassName>(), true) 107 108 /** 109 @brief Registers the class in the framework (for classes which should not be loaded through XML). 110 @param ClassName The name of the class 111 */ 112 #define RegisterUnloadableClass(ClassName) \ 113 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), false) 114 115 /** 116 @brief Registers an abstract class in the framework. 117 @param ClassName The name of the class 118 */ 119 #define RegisterAbstractClass(ClassName) \ 120 RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>(NULL), false) 121 122 /** 123 @brief Registers the class in the framework with a given Factory. 124 @param ClassName The name of the class 125 */ 126 #define RegisterClassWithFactory(ClassName, FactoryInstance, bLoadable) \ 127 Identifier& _##ClassName##Identifier = orxonox::registerClass<ClassName>(#ClassName, FactoryInstance, bLoadable) 128 129 /** 130 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName. 131 @param ClassName The name of the class 132 */ 133 #define RegisterObject(ClassName) \ 134 if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this)) \ 93 135 return; \ 94 136 else \ … … 96 138 97 139 /** 98 @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.99 @param ClassName The name of the class100 */101 #define RegisterObject(ClassName) \102 InternRegisterObject(ClassName, false)103 104 /**105 @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.106 @param ClassName The name of the class107 108 In contrast to RegisterObject, this is used for classes that inherit directly from109 orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject.110 */111 #define RegisterRootObject(ClassName) \112 InternRegisterObject(ClassName, true)113 114 /**115 @brief Creates the Factory.116 @param ClassName The name of the class117 */118 #define CreateFactory(ClassName) \119 Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName, true)120 121 /**122 @brief Creates the Factory for classes which should not be loaded through XML.123 @param ClassName The name of the class124 */125 #define CreateUnloadableFactory(ClassName) \126 Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName, false)127 128 /**129 140 @brief Returns the Identifier of the given class. 130 141 @param ClassName The name of the class … … 137 148 { 138 149 /** 150 * @brief Overload of registerClass() which determines T implicitly by the template argument of the ClassFactory. 151 */ 152 template <class T> 153 inline Identifier& registerClass(const std::string& name, ClassFactory<T>* factory, bool bLoadable = true) 154 { 155 return registerClass<T>(name, static_cast<Factory*>(factory), bLoadable); 156 } 157 158 /** 159 * @brief Registers a class in the framework. 160 * @param name The name of the class 161 * @param factory The factory which is able to create new instances of this class 162 * @param bLoadable Whether the class is allowed to be loaded through XML 163 */ 164 template <class T> 165 inline Identifier& registerClass(const std::string& name, Factory* factory, bool bLoadable = true) 166 { 167 orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl; 168 Identifier* identifier = ClassIdentifier<T>::getIdentifier(name); 169 identifier->setFactory(factory); 170 identifier->setLoadable(bLoadable); 171 return *identifier; 172 } 173 174 /** 139 175 @brief Returns the Identifier with a given name. 140 176 @param name The name of the class … … 142 178 inline Identifier* ClassByString(const std::string& name) 143 179 { 144 return Identifier ::getIdentifierByString(name);180 return IdentifierManager::getInstance().getIdentifierByString(name); 145 181 } 146 182 … … 151 187 inline Identifier* ClassByLowercaseString(const std::string& name) 152 188 { 153 return Identifier ::getIdentifierByLowercaseString(name);189 return IdentifierManager::getInstance().getIdentifierByLowercaseString(name); 154 190 } 155 191 … … 160 196 inline Identifier* ClassByID(uint32_t id) 161 197 { 162 return Identifier ::getIdentifierByID(id);198 return IdentifierManager::getInstance().getIdentifierByID(id); 163 199 } 164 200 165 201 /** 166 202 @brief Returns the Identifier with a given 'this' pointer. 167 @note This of course only works with OrxonoxClasses.203 @note This of course only works with Identifiables. 168 204 The only use is in conjunction with macros that don't know the class type. 169 @param object Pointer to an OrxonoxClass205 @param object Pointer to an Identifiable 170 206 */ 171 207 template <class T> -
code/trunk/src/libraries/core/CorePrereqs.h
r8351 r9667 127 127 class ClassFactory; 128 128 template <class T> 129 class ClassFactoryWithContext; 130 template <class T> 129 131 class ClassIdentifier; 130 132 class ClassTreeMask; … … 140 142 class ConfigFileManager; 141 143 class ConfigFileSection; 144 class Configurable; 142 145 class ConfigValueContainer; 146 class Context; 143 147 class Core; 148 class Destroyable; 144 149 class DestructionListener; 145 150 class DynLib; … … 154 159 class GraphicsManager; 155 160 class GUIManager; 161 class Identifiable; 156 162 class Identifier; 157 163 template <class T> 158 164 class Iterator; 159 165 class Language; 166 class Listable; 160 167 class LuaFunctor; 161 168 class LuaState; 162 169 class MemoryArchive; 163 170 class MemoryArchiveFactory; 164 class MetaObjectList;165 class MetaObjectListElement;166 171 class Namespace; 167 172 class NamespaceNode; … … 176 181 class OgreWindowEventListener; 177 182 class OrxonoxClass; 183 class OrxonoxInterface; 178 184 class PathConfig; 179 185 struct ResourceInfo; -
code/trunk/src/libraries/core/Event.cc
r8858 r9667 35 35 36 36 #include "BaseObject.h" 37 #include " Identifier.h"37 #include "class/Identifier.h" 38 38 39 39 namespace orxonox -
code/trunk/src/libraries/core/GUIManager.cc
r9576 r9667 78 78 #include "util/OrxAssert.h" 79 79 #include "util/output/BaseWriter.h" 80 #include " ConfigValueIncludes.h"80 #include "config/ConfigValueIncludes.h" 81 81 #include "Core.h" 82 82 #include "CoreIncludes.h" … … 256 256 , destructionHelper_(this) 257 257 { 258 Register RootObject(GUIManager);258 RegisterObject(GUIManager); 259 259 260 260 orxout(internal_status) << "initializing GUIManager..." << endl; -
code/trunk/src/libraries/core/GUIManager.h
r8862 r9667 49 49 #include "util/Singleton.h" 50 50 #include "input/InputHandler.h" 51 #include "OrxonoxClass.h"52 51 #include "WindowEventListener.h" 53 52 -
code/trunk/src/libraries/core/Game.cc
r8861 r9667 44 44 #include "util/Sleep.h" 45 45 #include "util/SubString.h" 46 #include "CommandLineParser.h"47 46 #include "Core.h" 48 47 #include "CoreIncludes.h" 49 #include "ConfigValueIncludes.h" 48 #include "config/CommandLineParser.h" 49 #include "config/ConfigValueIncludes.h" 50 50 #include "GameMode.h" 51 51 #include "GameState.h" … … 112 112 113 113 // Do this after the Core creation! 114 Register RootObject(Game);114 RegisterObject(Game); 115 115 this->setConfigValues(); 116 116 -
code/trunk/src/libraries/core/Game.h
r8858 r9667 50 50 #include "util/DestructionHelper.h" 51 51 #include "util/Singleton.h" 52 #include " OrxonoxClass.h"52 #include "config/Configurable.h" 53 53 54 54 /** … … 82 82 class _CoreExport Game 83 83 // tolua_end 84 : public Singleton<Game>, public OrxonoxClass84 : public Singleton<Game>, public Configurable 85 85 { // tolua_export 86 86 friend class Singleton<Game>; -
code/trunk/src/libraries/core/GraphicsManager.cc
r8861 r9667 52 52 #include "util/StringUtils.h" 53 53 #include "util/SubString.h" 54 #include " ConfigValueIncludes.h"54 #include "config/ConfigValueIncludes.h" 55 55 #include "CoreIncludes.h" 56 56 #include "Core.h" -
code/trunk/src/libraries/core/GraphicsManager.h
r8858 r9667 52 52 #include "util/DestructionHelper.h" 53 53 #include "util/Singleton.h" 54 #include " OrxonoxClass.h"54 #include "config/Configurable.h" 55 55 56 56 // tolua_begin … … 63 63 class _CoreExport GraphicsManager 64 64 // tolua_end 65 : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener65 : public Singleton<GraphicsManager>, public Configurable, public Ogre::LogListener 66 66 { // tolua_export 67 67 friend class Singleton<GraphicsManager>; -
code/trunk/src/libraries/core/Loader.cc
r8858 r9667 37 37 #include "util/StringUtils.h" 38 38 #include "BaseObject.h" 39 #include "Iterator.h"40 #include "ObjectList.h"41 39 #include "LuaState.h" 42 40 #include "Namespace.h" 43 41 #include "Resource.h" 44 42 #include "XMLFile.h" 43 #include "object/Iterator.h" 44 #include "object/ObjectList.h" 45 45 46 46 namespace orxonox … … 209 209 210 210 orxout(verbose, context::loader) << " creating root-namespace..." << endl; 211 Namespace* rootNamespace = new Namespace( 0);211 Namespace* rootNamespace = new Namespace(Context::getRootContext()); 212 212 rootNamespace->setLoaderIndentation(" "); 213 213 rootNamespace->setFile(file); -
code/trunk/src/libraries/core/Namespace.cc
r7401 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(Namespace);40 RegisterClass(Namespace); 41 41 42 Namespace::Namespace( BaseObject* creator) : BaseObject(creator),42 Namespace::Namespace(Context* context) : BaseObject(context), Context(context), 43 43 bAutogeneratedFileRootNamespace_(false), 44 44 bRoot_(false), -
code/trunk/src/libraries/core/Namespace.h
r7401 r9667 40 40 #include <string> 41 41 #include "BaseObject.h" 42 #include "object/Context.h" 42 43 43 44 namespace orxonox 44 45 { 45 class Namespace : public BaseObject 46 class Namespace : public BaseObject, public Context 46 47 { 47 48 public: 48 Namespace( BaseObject* creator);49 Namespace(Context* context); 49 50 virtual ~Namespace(); 50 51 -
code/trunk/src/libraries/core/PathConfig.cc
r9550 r9667 53 53 #include "util/Output.h" 54 54 #include "util/Exception.h" 55 #include " CommandLineParser.h"55 #include "config/CommandLineParser.h" 56 56 57 57 // Differentiate Boost Filesystem v2 and v3 -
code/trunk/src/libraries/core/Template.cc
r9348 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(Template);40 RegisterClass(Template); 41 41 42 Template::Template( BaseObject* creator) : BaseObject(creator)42 Template::Template(Context* context) : BaseObject(context) 43 43 { 44 44 this->xmlelement_ = new TiXmlElement(""); … … 150 150 151 151 // check if the template is applied on an object of the right type 152 Identifier* identifier = Identifier::getIdentifierByString(this->getXMLElement().Value());152 Identifier* identifier = ClassByString(this->getXMLElement().Value()); 153 153 if (!object->getIdentifier()->isA(identifier)) 154 154 orxout(internal_warning, context::templates) << "Template was defined for " << identifier->getName() << " but the object is of type " << object->getIdentifier()->getName() << endl; -
code/trunk/src/libraries/core/Template.h
r7401 r9667 51 51 { 52 52 public: 53 Template( BaseObject* creator);53 Template(Context* context); 54 54 virtual ~Template(); 55 55 -
code/trunk/src/libraries/core/ViewportEventListener.cc
r8079 r9667 32 32 namespace orxonox 33 33 { 34 RegisterAbstractClass(ViewportEventListener).inheritsFrom(Class(Listable)); 35 34 36 ViewportEventListener::ViewportEventListener() 35 37 { 36 Register RootObject(ViewportEventListener);38 RegisterObject(ViewportEventListener); 37 39 } 38 40 } -
code/trunk/src/libraries/core/ViewportEventListener.h
r8729 r9667 33 33 34 34 #include "util/OgreForwardRefs.h" 35 #include " OrxonoxClass.h"35 #include "object/Listable.h" 36 36 37 37 namespace orxonox 38 38 { 39 class _CoreExport ViewportEventListener : virtual public OrxonoxClass39 class _CoreExport ViewportEventListener : virtual public Listable 40 40 { 41 41 public: -
code/trunk/src/libraries/core/WindowEventListener.cc
r7874 r9667 35 35 unsigned int WindowEventListener::windowHeight_s = 0; 36 36 37 RegisterAbstractClass(WindowEventListener).inheritsFrom(Class(Listable)); 38 37 39 WindowEventListener::WindowEventListener() 38 40 { 39 Register RootObject(WindowEventListener);41 RegisterObject(WindowEventListener); 40 42 } 41 43 -
code/trunk/src/libraries/core/WindowEventListener.h
r7874 r9667 36 36 37 37 #include "CorePrereqs.h" 38 #include " OrxonoxClass.h"38 #include "object/Listable.h" 39 39 40 40 namespace orxonox 41 41 { 42 42 //! Interface for receiving window events like resize, moved and focusChanged 43 class _CoreExport WindowEventListener : virtual public OrxonoxClass43 class _CoreExport WindowEventListener : virtual public Listable 44 44 { 45 45 friend class OgreWindowEventListener; -
code/trunk/src/libraries/core/XMLNameListener.cc
r5781 r9667 32 32 namespace orxonox 33 33 { 34 RegisterAbstractClass(XMLNameListener).inheritsFrom(Class(Listable)); 35 34 36 XMLNameListener::XMLNameListener() 35 37 { 36 Register RootObject(XMLNameListener);38 RegisterObject(XMLNameListener); 37 39 } 38 40 } -
code/trunk/src/libraries/core/XMLNameListener.h
r7401 r9667 36 36 37 37 #include "CorePrereqs.h" 38 #include " OrxonoxClass.h"38 #include "object/Listable.h" 39 39 40 40 namespace orxonox 41 41 { 42 class _CoreExport XMLNameListener : virtual public OrxonoxClass42 class _CoreExport XMLNameListener : virtual public Listable 43 43 { 44 44 public: -
code/trunk/src/libraries/core/XMLPort.cc
r8858 r9667 29 29 #include "XMLPort.h" 30 30 31 #include "CoreIncludes.h" 31 32 #include "Loader.h" 32 33 #include "Namespace.h" … … 59 60 for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++) 60 61 { 61 Identifier* identifier = Identifier::getIdentifierByString(child->Value());62 Identifier* identifier = ClassByString(child->Value()); 62 63 if (!identifier) 63 64 { … … 89 90 orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl; 90 91 91 BaseObject* newObject = identifier->fabricate(object);92 BaseObject* newObject = orxonox_cast<BaseObject*>(identifier->fabricate(object->getContext())); 92 93 newObject->setLoaderIndentation(object->getLoaderIndentation() + " "); 93 94 -
code/trunk/src/libraries/core/XMLPort.h
r9348 r9667 58 58 #include "util/OrxAssert.h" 59 59 #include "util/StringUtils.h" 60 #include " Identifier.h"60 #include "class/Identifier.h" 61 61 #include "BaseObject.h" 62 62 #include "command/Executor.h" -
code/trunk/src/libraries/core/class/CMakeLists.txt
r9577 r9667 3 3 Identifier.cc 4 4 IdentifierManager.cc 5 OrxonoxClass.cc 6 OrxonoxInterface.cc 5 7 ) -
code/trunk/src/libraries/core/class/Identifiable.cc
r9574 r9667 35 35 36 36 #include <cassert> 37 #include "core/CoreIncludes.h" 37 38 #include "core/object/Context.h" 38 39 #include "Identifier.h" … … 40 41 namespace orxonox 41 42 { 43 RegisterClassNoArgs(Identifiable); 44 42 45 /** 43 46 @brief Constructor: Sets the default values. … … 46 49 { 47 50 this->identifier_ = 0; 48 this->parents_ = 0; 49 // Optimisation 50 this->objectPointers_.reserve(6); 51 } 51 this->objectPointers_.reserve(6); // Optimisation 52 52 53 /** 54 @brief Destructor: Removes the object from the object-lists 55 */ 56 Identifiable::~Identifiable() 57 { 58 // parents_ exists only if isCreatingHierarchy() of the associated Identifier returned true while creating the class 59 if (this->parents_) 60 delete this->parents_; 53 RegisterObject(Identifiable); 61 54 } 62 55 -
code/trunk/src/libraries/core/class/Identifiable.h
r9574 r9667 55 55 public: 56 56 Identifiable(); 57 virtual ~Identifiable() ;57 virtual ~Identifiable() {} 58 58 59 59 /// Returns the Identifier of the object. … … 119 119 private: 120 120 Identifier* identifier_; //!< The Identifier of the object 121 std::set<const Identifier*>* parents_; //!< List of all parents of the object122 121 123 122 /// 'Fast map' that holds this-pointers of all derived types -
code/trunk/src/libraries/core/class/Identifier.cc
r9593 r9667 37 37 38 38 #include "util/StringUtils.h" 39 #include "core/CoreIncludes.h" 39 40 #include "core/config/ConfigValueContainer.h" 40 41 #include "core/XMLPort.h" … … 50 51 */ 51 52 Identifier::Identifier() 52 : classID_(IdentifierManager::classIDCounter_s++) 53 { 54 this->objects_ = new ObjectListBase(); 55 56 this->bCreatedOneObject_ = false; 57 this->bSetName_ = false; 53 : classID_(IdentifierManager::getInstance().getUniqueClassId()) 54 { 58 55 this->factory_ = 0; 56 this->bInitialized_ = false; 59 57 this->bLoadable_ = false; 60 58 … … 70 68 Identifier::~Identifier() 71 69 { 72 delete this->objects_;73 74 70 if (this->factory_) 75 71 delete this->factory_; … … 84 80 85 81 /** 86 @brief Registers a class, which means that the name and the parents get stored.87 @param parents A list, containing the Identifiers of all parents of the class88 @param bRootClass True if the class is either an Interface or the BaseObject itself89 */90 void Identifier::initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass)91 {92 // Check if at least one object of the given type was created93 if (!this->bCreatedOneObject_ && IdentifierManager::isCreatingHierarchy())94 {95 // If no: We have to store the information and initialize the Identifier96 orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;97 if (bRootClass)98 this->initialize(0); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.99 else100 this->initialize(parents);101 }102 }103 104 /**105 @brief Initializes the Identifier with a list containing all parents of the class the Identifier belongs to.106 @param parents A list containing all parents107 */108 void Identifier::initialize(std::set<const Identifier*>* parents)109 {110 orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;111 this->bCreatedOneObject_ = true;112 113 if (parents)114 {115 this->parents_ = (*parents);116 this->directParents_ = (*parents);117 118 // Iterate through all parents119 for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)120 {121 // Tell the parent we're one of it's children122 (*it)->children_.insert((*it)->children_.end(), this);123 124 // Erase all parents of our parent from our direct-parent-list125 for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)126 {127 // Search for the parent's parent in our direct-parent-list128 for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)129 {130 if ((*it1) == (*it2))131 {132 // We've found a non-direct parent in our list: Erase it133 this->directParents_.erase(it2);134 break;135 }136 }137 }138 }139 140 // Now iterate through all direct parents141 for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)142 {143 // Tell the parent we're one of it's direct children144 (*it)->directChildren_.insert((*it)->directChildren_.end(), this);145 146 // Create the super-function dependencies147 (*it)->createSuperFunctionCaller();148 }149 }150 }151 152 /**153 82 @brief Sets the name of the class. 154 83 */ 155 84 void Identifier::setName(const std::string& name) 156 85 { 157 if ( !this->bSetName_)86 if (name != this->name_) 158 87 { 159 88 this->name_ = name; 160 this->bSetName_ = true; 161 IdentifierManager::getStringIdentifierMapIntern()[name] = this; 162 IdentifierManager::getLowercaseStringIdentifierMapIntern()[getLowercase(name)] = this; 163 IdentifierManager::getIDIdentifierMapIntern()[this->networkID_] = this; 164 } 165 } 89 IdentifierManager::getInstance().addIdentifierToLookupMaps(this); 90 } 91 } 92 93 void Identifier::setFactory(Factory* factory) 94 { 95 if (this->factory_) 96 delete this->factory_; 97 98 this->factory_ = factory; 99 } 100 166 101 167 102 /** … … 169 104 @return The new object 170 105 */ 171 OrxonoxClass* Identifier::fabricate(BaseObject* creator)106 Identifiable* Identifier::fabricate(Context* context) 172 107 { 173 108 if (this->factory_) 174 109 { 175 return this->factory_->fabricate(c reator);110 return this->factory_->fabricate(context); 176 111 } 177 112 else … … 190 125 void Identifier::setNetworkID(uint32_t id) 191 126 { 192 // Identifier::getIDIdentifierMapIntern().erase(this->networkID_);193 IdentifierManager::getIDIdentifierMapIntern()[id] = this;194 127 this->networkID_ = id; 128 IdentifierManager::getInstance().addIdentifierToLookupMaps(this); 129 } 130 131 /** 132 * @brief Used to define the direct parents of an Identifier of an abstract class. 133 */ 134 Identifier& Identifier::inheritsFrom(Identifier* directParent) 135 { 136 if (this->parents_.empty()) 137 this->directParents_.insert(directParent); 138 else 139 orxout(internal_error) << "Trying to add " << directParent->getName() << " as a direct parent of " << this->getName() << " after the latter was already initialized" << endl; 140 141 return *this; 142 } 143 144 /** 145 * @brief Initializes the parents of this Identifier while creating the class hierarchy. 146 * @param identifiers All identifiers that were used to create an instance of this class (including this identifier itself) 147 */ 148 void Identifier::initializeParents(const std::set<const Identifier*>& identifiers) 149 { 150 if (!IdentifierManager::getInstance().isCreatingHierarchy()) 151 { 152 orxout(internal_warning) << "Identifier::initializeParents() created outside of class hierarchy creation" << endl; 153 return; 154 } 155 156 for (std::set<const Identifier*>::const_iterator it = identifiers.begin(); it != identifiers.end(); ++it) 157 if (*it != this) 158 this->parents_.insert(*it); 159 } 160 161 /** 162 * @brief Initializes the direct parents of this Identifier while creating the class hierarchy. This is only intended for abstract classes. 163 */ 164 void Identifier::initializeDirectParentsOfAbstractClass() 165 { 166 if (!IdentifierManager::getInstance().isCreatingHierarchy()) 167 { 168 orxout(internal_warning) << "Identifier::initializeDirectParentsOfAbstractClass() created outside of class hierarchy creation" << endl; 169 return; 170 } 171 172 // only Identifiable is allowed to have no parents (even tough it's currently not abstract) 173 if (this->directParents_.empty() && !this->isExactlyA(Class(Identifiable))) 174 { 175 orxout(internal_error) << "Identifier " << this->getName() << " / " << this->getTypeidName() << " is marked as abstract but has no direct parents defined" << endl; 176 orxout(internal_error) << " If this class is not abstract, use RegisterClass(ThisClass);" << endl; 177 orxout(internal_error) << " If this class is abstract, use RegisterAbstractClass(ThisClass).inheritsFrom(Class(BaseClass));" << endl; 178 } 179 } 180 181 /** 182 * @brief Finishes the initialization of this Identifier after creating the class hierarchy by wiring the (direct) parent/child references correctly. 183 */ 184 void Identifier::finishInitialization() 185 { 186 if (!IdentifierManager::getInstance().isCreatingHierarchy()) 187 { 188 orxout(internal_warning) << "Identifier::finishInitialization() created outside of class hierarchy creation" << endl; 189 return; 190 } 191 192 if (this->isInitialized()) 193 return; 194 195 // if no direct parents were defined, initialize them with the set of all parents 196 if (this->directParents_.empty()) 197 this->directParents_ = this->parents_; 198 199 // initialize all parents before continuing to initialize this identifier 200 for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it) 201 { 202 Identifier* directParent = const_cast<Identifier*>(*it); 203 directParent->finishInitialization(); // initialize parent 204 this->parents_.insert(directParent); // direct parent is also a parent 205 this->parents_.insert(directParent->parents_.begin(), directParent->parents_.end()); // parents of direct parent are also parents 206 } 207 208 // parents of parents are no direct parents of this identifier 209 for (std::set<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent) 210 for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent) 211 this->directParents_.erase(*it_parent_parent); 212 213 // tell all parents that this identifier is a child 214 for (std::set<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it) 215 const_cast<Identifier*>(*it)->children_.insert(this); 216 217 // tell all direct parents that this identifier is a direct child 218 for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it) 219 { 220 const_cast<Identifier*>(*it)->directChildren_.insert(this); 221 222 // Create the super-function dependencies 223 (*it)->createSuperFunctionCaller(); 224 } 225 226 this->bInitialized_ = true; 195 227 } 196 228 -
code/trunk/src/libraries/core/class/Identifier.h
r9593 r9667 56 56 object->getIdentifier()->getName(); // returns "MyClass" 57 57 58 OrxonoxClass* other = object->getIdentifier()->fabricate(0); // fabricates a new instance of MyClass 59 60 61 // iterate through all objects of type MyClass: 62 ObjectListBase* objects = object->getIdentifier()->getObjects(); // get a pointer to the object-list 63 int count; 64 for (Iterator<MyClass> it = objects.begin(); it != objects.end(); ++it) // iterate through the objects 65 ++count; 66 orxout() << count << endl; // prints "2" because we created 2 instances of MyClass so far 58 Identifiable* other = object->getIdentifier()->fabricate(0); // fabricates a new instance of MyClass 67 59 68 60 … … 90 82 91 83 #include "util/Output.h" 92 #include "core/object/MetaObjectList.h"93 84 #include "core/object/ObjectList.h" 94 #include "core/object/ObjectListBase.h" 85 #include "core/object/Listable.h" 86 #include "core/object/Context.h" 87 #include "core/object/Destroyable.h" 88 #include "core/object/WeakPtr.h" 95 89 #include "IdentifierManager.h" 96 90 #include "Super.h" … … 112 106 @note You can't directly create an Identifier, it's just the base-class of ClassIdentifier<T>. 113 107 */ 114 class _CoreExport Identifier 115 { 116 friend class IdentifierManager; 117 108 class _CoreExport Identifier : public Destroyable 109 { 118 110 public: 111 Identifier(); 112 Identifier(const Identifier& identifier); // don't copy 113 virtual ~Identifier(); 114 119 115 /// Returns the name of the class the Identifier belongs to. 120 116 inline const std::string& getName() const { return this->name_; } 121 117 void setName(const std::string& name); 122 118 119 /// Returns the name of the class as it is returned by typeid(T).name() 120 virtual const std::string& getTypeidName() = 0; 121 123 122 /// Returns the network ID to identify a class through the network. 124 123 inline uint32_t getNetworkID() const { return this->networkID_; } … … 128 127 ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; } 129 128 130 /// Returns the list of all existing objects of this class.131 inline ObjectListBase* getObjects() const { return this->objects_; }132 133 129 /// Sets the Factory. 134 inline void addFactory(Factory* factory) { this->factory_ = factory; }130 void setFactory(Factory* factory); 135 131 /// Returns true if the Identifier has a Factory. 136 132 inline bool hasFactory() const { return (this->factory_ != 0); } 137 133 138 OrxonoxClass* fabricate(BaseObject* creator);134 Identifiable* fabricate(Context* context); 139 135 140 136 /// Returns true if the class can be loaded through XML. … … 142 138 /// Set the class to be loadable through XML or not. 143 139 inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; } 140 141 /// Returns true if the Identifier was completely initialized. 142 inline bool isInitialized() const { return this->bInitialized_; } 143 144 145 ///////////////////////////// 146 ////// Class Hierarchy ////// 147 ///////////////////////////// 148 Identifier& inheritsFrom(Identifier* directParent); 149 150 void initializeParents(const std::set<const Identifier*>& identifiers); 151 void initializeDirectParentsOfAbstractClass(); 152 void finishInitialization(); 144 153 145 154 bool isA(const Identifier* identifier) const; … … 150 159 bool isDirectParentOf(const Identifier* identifier) const; 151 160 152 153 /////////////////////////////154 ////// Class Hierarchy //////155 /////////////////////////////156 161 /// Returns the parents of the class the Identifier belongs to. 157 162 inline const std::set<const Identifier*>& getParents() const { return this->parents_; } … … 220 225 221 226 protected: 222 Identifier();223 Identifier(const Identifier& identifier); // don't copy224 virtual ~Identifier();225 226 227 virtual void createSuperFunctionCaller() const = 0; 227 228 228 void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);229 230 /// Returns the children of the class the Identifier belongs to.231 inline std::set<const Identifier*>& getChildrenIntern() const { return this->children_; }232 /// Returns the direct children of the class the Identifier belongs to.233 inline std::set<const Identifier*>& getDirectChildrenIntern() const { return this->directChildren_; }234 235 ObjectListBase* objects_; //!< The list of all objects of this class236 237 229 private: 238 void initialize(std::set<const Identifier*>* parents);239 240 230 std::set<const Identifier*> parents_; //!< The parents of the class the Identifier belongs to 241 mutable std::set<const Identifier*> children_;//!< The children of the class the Identifier belongs to231 std::set<const Identifier*> children_; //!< The children of the class the Identifier belongs to 242 232 243 233 std::set<const Identifier*> directParents_; //!< The direct parents of the class the Identifier belongs to 244 mutable std::set<const Identifier*> directChildren_; //!< The direct children of the class the Identifier belongs to 245 246 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) 247 bool bSetName_; //!< True if the name is set 234 std::set<const Identifier*> directChildren_; //!< The direct children of the class the Identifier belongs to 235 236 bool bInitialized_; //!< Is true if the Identifier was completely initialized 248 237 bool bLoadable_; //!< False = it's not permitted to load the object through XML 249 238 std::string name_; //!< The name of the class the Identifier belongs to … … 287 276 static ClassIdentifier<T>* getIdentifier(const std::string& name); 288 277 289 bool initiali seObject(T* object, const std::string& className, bool bRootClass);278 bool initializeObject(T* object); 290 279 291 280 void setConfigValues(T* object, Configurable*) const; … … 295 284 void addObjectToList(T* object, Identifiable*); 296 285 297 void updateConfigValues(bool updateChildren = true) const; 286 virtual void updateConfigValues(bool updateChildren = true) const; 287 288 virtual const std::string& getTypeidName() 289 { return this->typeidName_; } 298 290 299 291 private: 300 static void initialiseIdentifier(); 292 static void initializeIdentifier(); 293 301 294 ClassIdentifier(const ClassIdentifier<T>& identifier) {} // don't copy 302 295 ClassIdentifier() 303 296 { 297 this->typeidName_ = typeid(T).name(); 304 298 SuperFunctionInitialization<0, T>::initialize(this); 305 299 } … … 309 303 } 310 304 311 static ClassIdentifier<T>* classIdentifier_s; 305 void updateConfigValues(bool updateChildren, Listable*) const; 306 void updateConfigValues(bool updateChildren, Identifiable*) const; 307 308 std::string typeidName_; 309 static WeakPtr<ClassIdentifier<T> > classIdentifier_s; 312 310 }; 313 311 314 312 template <class T> 315 ClassIdentifier<T>* ClassIdentifier<T>::classIdentifier_s = 0;313 WeakPtr<ClassIdentifier<T> > ClassIdentifier<T>::classIdentifier_s; 316 314 317 315 /** … … 324 322 // check if the Identifier already exists 325 323 if (!ClassIdentifier<T>::classIdentifier_s) 326 ClassIdentifier<T>::initiali seIdentifier();324 ClassIdentifier<T>::initializeIdentifier(); 327 325 328 326 return ClassIdentifier<T>::classIdentifier_s; … … 346 344 */ 347 345 template <class T> 348 void ClassIdentifier<T>::initialiseIdentifier() 349 { 350 // Get the name of the class 351 std::string name = typeid(T).name(); 352 353 // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used. 346 /*static */ void ClassIdentifier<T>::initializeIdentifier() 347 { 348 // create a new identifier anyway. Will be deleted if not used. 354 349 ClassIdentifier<T>* proposal = new ClassIdentifier<T>(); 355 350 356 351 // Get the entry from the map 357 ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getI dentifierSingleton(name,proposal);352 ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getInstance().getGloballyUniqueIdentifier(proposal); 358 353 359 354 if (ClassIdentifier<T>::classIdentifier_s == proposal) 360 { 361 orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was not yet existing and got created." << endl; 362 } 355 orxout(verbose, context::identifier) << "Requested Identifier for " << proposal->getTypeidName() << " was not yet existing and got created." << endl; 363 356 else 364 357 { 365 orxout(verbose, context::identifier) << "Requested Identifier for " << name << " was already existing and got assigned." << endl; 358 orxout(verbose, context::identifier) << "Requested Identifier for " << proposal->getTypeidName() << " was already existing and got assigned." << endl; 359 delete proposal; // delete proposal (it is not used anymore) 366 360 } 367 361 } … … 370 364 @brief Adds an object of the given type to the ObjectList. 371 365 @param object The object to add 372 @param className The name of the class T 373 @param bRootClass True if this is a root class (i.e. it inherits directly from OrxonoxClass) 374 */ 375 template <class T> 376 bool ClassIdentifier<T>::initialiseObject(T* object, const std::string& className, bool bRootClass) 377 { 378 if (bRootClass) 379 orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl; 380 else 381 orxout(verbose, context::object_list) << "Register Object: " << className << endl; 366 */ 367 template <class T> 368 bool ClassIdentifier<T>::initializeObject(T* object) 369 { 370 orxout(verbose, context::object_list) << "Register Object: " << this->getName() << endl; 382 371 383 372 object->identifier_ = this; 384 if (IdentifierManager:: isCreatingHierarchy())373 if (IdentifierManager::getInstance().isCreatingHierarchy()) 385 374 { 386 if (bRootClass && !object->parents_) 387 object->parents_ = new std::set<const Identifier*>(); 388 389 if (object->parents_) 390 { 391 this->initializeClassHierarchy(object->parents_, bRootClass); 392 object->parents_->insert(object->parents_->end(), this); 393 } 375 IdentifierManager::getInstance().createdObject(object); 394 376 395 377 this->setConfigValues(object, object); … … 425 407 */ 426 408 template <class T> 427 void ClassIdentifier<T>::addObjectToList(T* object, Listable* )428 { 429 orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;430 object->metaList_->add(this->objects_, this->objects_->add(object));409 void ClassIdentifier<T>::addObjectToList(T* object, Listable* listable) 410 { 411 if (listable->getContext()) 412 listable->getContext()->addObject(object); 431 413 } 432 414 … … 442 424 template <class T> 443 425 void ClassIdentifier<T>::updateConfigValues(bool updateChildren) const 426 { 427 this->updateConfigValues(updateChildren, static_cast<T*>(NULL)); 428 } 429 430 template <class T> 431 void ClassIdentifier<T>::updateConfigValues(bool updateChildren, Listable*) const 444 432 { 445 433 if (!this->hasConfigValues()) … … 452 440 for (std::set<const Identifier*>::const_iterator it = this->getChildrenBegin(); it != this->getChildrenEnd(); ++it) 453 441 (*it)->updateConfigValues(false); 442 } 443 444 template <class T> 445 void ClassIdentifier<T>::updateConfigValues(bool updateChildren, Identifiable*) const 446 { 447 // no action 454 448 } 455 449 -
code/trunk/src/libraries/core/class/IdentifierManager.cc
r9564 r9667 37 37 38 38 #include "util/StringUtils.h" 39 #include "core/CoreIncludes.h" 39 40 #include "core/config/ConfigValueContainer.h" 40 41 #include "core/XMLPort.h" … … 43 44 namespace orxonox 44 45 { 45 int IdentifierManager::hierarchyCreatingCounter_s = 0;46 unsigned int IdentifierManager::classIDCounter_s = 0;47 48 /**49 @brief Returns the identifier map with the names as received by typeid(). This is only used internally.50 */ 51 std::map<std::string, Identifier*>& IdentifierManager::getTypeIDIdentifierMap()52 { 53 static std::map<std::string, Identifier*> identifiers; //!< The map to store all Identifiers.54 return identifiers;46 /* static */ IdentifierManager& IdentifierManager::getInstance() 47 { 48 static IdentifierManager instance; 49 return instance; 50 } 51 52 IdentifierManager::IdentifierManager() 53 { 54 this->hierarchyCreatingCounter_s = 0; 55 this->classIDCounter_s = 0; 55 56 } 56 57 57 58 /** 58 59 @brief Returns an identifier by name and adds it if not available 59 @param name The name of the identifier as typeid().name() suggests60 60 @param proposal A pointer to a newly created identifier for the case of non existence in the map 61 61 @return The identifier (unique instance) 62 62 */ 63 Identifier* IdentifierManager::get IdentifierSingleton(const std::string& name,Identifier* proposal)64 { 65 std::map<std::string, Identifier*>::const_iterator it = getTypeIDIdentifierMap().find(name);66 67 if (it != getTypeIDIdentifierMap().end()) 68 {69 // There is already an entry: return it and delete the proposal70 delete proposal;63 Identifier* IdentifierManager::getGloballyUniqueIdentifier(Identifier* proposal) 64 { 65 const std::string& typeidName = proposal->getTypeidName(); 66 std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.find(typeidName); 67 68 if (it != this->identifierByTypeidName_.end()) 69 { 70 // There is already an entry: return it 71 71 return it->second; 72 72 } … … 74 74 { 75 75 // There is no entry: put the proposal into the map and return it 76 getTypeIDIdentifierMap()[name] = proposal;76 this->identifierByTypeidName_[typeidName] = proposal; 77 77 return proposal; 78 78 } … … 80 80 81 81 /** 82 * Registers the identifier in all maps of the IdentifierManager. 83 */ 84 void IdentifierManager::addIdentifierToLookupMaps(Identifier* identifier) 85 { 86 const std::string& typeidName = identifier->getTypeidName(); 87 if (this->identifierByTypeidName_.find(typeidName) != this->identifierByTypeidName_.end()) 88 { 89 this->identifierByString_[identifier->getName()] = identifier; 90 this->identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier; 91 this->identifierByNetworkId_[identifier->getNetworkID()] = identifier; 92 } 93 else 94 orxout(internal_warning) << "Trying to add an identifier to lookup maps which is not known to IdentifierManager" << endl; 95 } 96 97 /** 82 98 @brief Creates the class-hierarchy by creating and destroying one object of each type. 83 99 */ … … 85 101 { 86 102 orxout(internal_status) << "Create class-hierarchy" << endl; 87 IdentifierManager::startCreatingHierarchy(); 88 for (std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getStringIdentifierMap().begin(); it != IdentifierManager::getStringIdentifierMap().end(); ++it) 89 { 90 // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards. 91 if (it->second->hasFactory()) 103 this->startCreatingHierarchy(); 104 105 std::set<Identifier*> initializedIdentifiers; 106 107 // ensure root context exists before starting to create objects. if the root context is dynamically created while creating the class hierarchy, we 108 // would mistakenly assume the class of the currently created object inherits from Context 109 Context::getRootContext(); 110 111 // iterate over all identifiers, create one instance of each class and initialize the identifiers 112 { 113 Context temporaryContext(NULL); 114 for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it) 92 115 { 93 OrxonoxClass* temp = it->second->fabricate(0); 94 temp->destroy(); 116 orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << it->second->getName() << ">-Singleton." << endl; 117 // To initialize the identifier, we create a new object and delete it afterwards. 118 if (it->second->hasFactory()) 119 { 120 this->identifiersOfNewObject_.clear(); 121 Identifiable* temp = it->second->fabricate(&temporaryContext); 122 if (temp->getIdentifier() != it->second) 123 orxout(internal_error) << "Newly created object of type " << it->second->getName() << " has unexpected identifier. Did you forget to use RegisterObject(classname)?" << endl; 124 delete temp; 125 126 it->second->initializeParents(this->identifiersOfNewObject_); 127 } 128 else 129 it->second->initializeDirectParentsOfAbstractClass(); 130 131 initializedIdentifiers.insert(it->second); 95 132 } 96 } 97 IdentifierManager::stopCreatingHierarchy(); 133 134 size_t numberOfObjects = temporaryContext.getObjectList<Listable>()->size(); 135 if (numberOfObjects > 0) 136 orxout(internal_warning) << "There are still " << numberOfObjects << " listables left after creating the class hierarchy" << endl; 137 } 138 139 // finish the initialization of all identifiers 140 for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it) 141 { 142 if (initializedIdentifiers.find(it->second) != initializedIdentifiers.end()) 143 it->second->finishInitialization(); 144 else 145 orxout(internal_error) << "Identifier was registered late and is not initialized: " << it->second->getName() << " / " << it->second->getTypeidName() << endl; 146 } 147 148 this->stopCreatingHierarchy(); 98 149 orxout(internal_status) << "Finished class-hierarchy creation" << endl; 99 150 } … … 104 155 void IdentifierManager::destroyAllIdentifiers() 105 156 { 106 for (std::map<std::string, Identifier*>::iterator it = IdentifierManager::getTypeIDIdentifierMap().begin(); it != IdentifierManager::getTypeIDIdentifierMap().end(); ++it)157 for (std::map<std::string, Identifier*>::iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it) 107 158 delete (it->second); 108 } 109 110 /** 111 @brief Returns the map that stores all Identifiers with their names. 112 @return The map 113 */ 114 std::map<std::string, Identifier*>& IdentifierManager::getStringIdentifierMapIntern() 115 { 116 static std::map<std::string, Identifier*> identifierMap; 117 return identifierMap; 118 } 119 120 /** 121 @brief Returns the map that stores all Identifiers with their names in lowercase. 122 @return The map 123 */ 124 std::map<std::string, Identifier*>& IdentifierManager::getLowercaseStringIdentifierMapIntern() 125 { 126 static std::map<std::string, Identifier*> lowercaseIdentifierMap; 127 return lowercaseIdentifierMap; 128 } 129 130 /** 131 @brief Returns the map that stores all Identifiers with their network IDs. 132 @return The map 133 */ 134 std::map<uint32_t, Identifier*>& IdentifierManager::getIDIdentifierMapIntern() 135 { 136 static std::map<uint32_t, Identifier*> identifierMap; 137 return identifierMap; 159 160 this->identifierByTypeidName_.clear(); 161 this->identifierByString_.clear(); 162 this->identifierByLowercaseString_.clear(); 163 this->identifierByNetworkId_.clear(); 164 } 165 166 /** 167 * @brief Notifies the IdentifierManager about a newly created object while creating the class hierarchy. 168 */ 169 void IdentifierManager::createdObject(Identifiable* identifiable) 170 { 171 if (this->isCreatingHierarchy()) 172 this->identifiersOfNewObject_.insert(identifiable->getIdentifier()); 173 else 174 orxout(internal_warning) << "createdObject() called outside of class hierarchy creation" << endl; 138 175 } 139 176 … … 145 182 Identifier* IdentifierManager::getIdentifierByString(const std::string& name) 146 183 { 147 std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getStringIdentifierMapIntern().find(name);148 if (it != IdentifierManager::getStringIdentifierMapIntern().end())184 std::map<std::string, Identifier*>::const_iterator it = this->identifierByString_.find(name); 185 if (it != this->identifierByString_.end()) 149 186 return it->second; 150 187 else … … 159 196 Identifier* IdentifierManager::getIdentifierByLowercaseString(const std::string& name) 160 197 { 161 std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getLowercaseStringIdentifierMapIntern().find(name);162 if (it != IdentifierManager::getLowercaseStringIdentifierMapIntern().end())198 std::map<std::string, Identifier*>::const_iterator it = this->identifierByLowercaseString_.find(name); 199 if (it != this->identifierByLowercaseString_.end()) 163 200 return it->second; 164 201 else … … 173 210 Identifier* IdentifierManager::getIdentifierByID(const uint32_t id) 174 211 { 175 std::map<uint32_t, Identifier*>::const_iterator it = IdentifierManager::getIDIdentifierMapIntern().find(id);176 if (it != IdentifierManager::getIDIdentifierMapIntern().end())212 std::map<uint32_t, Identifier*>::const_iterator it = this->identifierByNetworkId_.find(id); 213 if (it != this->identifierByNetworkId_.end()) 177 214 return it->second; 178 215 else … … 185 222 void IdentifierManager::clearNetworkIDs() 186 223 { 187 IdentifierManager::getIDIdentifierMapIntern().clear();224 this->identifierByNetworkId_.clear(); 188 225 } 189 226 } -
code/trunk/src/libraries/core/class/IdentifierManager.h
r9564 r9667 38 38 39 39 #include <map> 40 #include <set> 40 41 #include <string> 41 42 … … 44 45 class _CoreExport IdentifierManager 45 46 { 46 friend class Identifier;47 template <class T> friend class ClassIdentifier;47 public: 48 static IdentifierManager& getInstance(); 48 49 49 public: 50 Identifier* getGloballyUniqueIdentifier(Identifier* proposal); 51 void addIdentifierToLookupMaps(Identifier* identifier); 52 53 unsigned int getUniqueClassId() 54 { return this->classIDCounter_s++; } 55 56 50 57 ///////////////////////////// 51 58 ////// Class Hierarchy ////// 52 59 ///////////////////////////// 53 static void createClassHierarchy(); 60 void createClassHierarchy(); 61 void destroyAllIdentifiers(); 62 63 void createdObject(Identifiable* identifiable); 54 64 55 65 /// Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. 56 inline staticbool isCreatingHierarchy()66 inline bool isCreatingHierarchy() 57 67 { return (hierarchyCreatingCounter_s > 0); } 58 68 … … 61 71 ///// Identifier Map ///// 62 72 ////////////////////////// 63 static void destroyAllIdentifiers(); 73 Identifier* getIdentifierByString(const std::string& name); 74 Identifier* getIdentifierByLowercaseString(const std::string& name); 75 Identifier* getIdentifierByID(uint32_t id); 64 76 65 static Identifier* getIdentifierByString(const std::string& name); 66 static Identifier* getIdentifierByLowercaseString(const std::string& name); 67 static Identifier* getIdentifierByID(uint32_t id); 68 69 static void clearNetworkIDs(); 77 void clearNetworkIDs(); 70 78 71 79 /// Returns the map that stores all Identifiers with their names. 72 static inline const std::map<std::string, Identifier*>& getStringIdentifierMap() 73 { return IdentifierManager::getStringIdentifierMapIntern(); } 74 /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their names. 75 static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapBegin() 76 { return IdentifierManager::getStringIdentifierMap().begin(); } 77 /// Returns a const_iterator to the end of the map that stores all Identifiers with their names. 78 static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapEnd() 79 { return IdentifierManager::getStringIdentifierMap().end(); } 80 80 inline const std::map<std::string, Identifier*>& getIdentifierByStringMap() 81 { return this->identifierByString_; } 81 82 /// Returns the map that stores all Identifiers with their names in lowercase. 82 static inline const std::map<std::string, Identifier*>& getLowercaseStringIdentifierMap() 83 { return IdentifierManager::getLowercaseStringIdentifierMapIntern(); } 84 /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase. 85 static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapBegin() 86 { return IdentifierManager::getLowercaseStringIdentifierMap().begin(); } 87 /// Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase. 88 static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapEnd() 89 { return IdentifierManager::getLowercaseStringIdentifierMap().end(); } 90 83 inline const std::map<std::string, Identifier*>& getIdentifierByLowercaseStringMap() 84 { return this->identifierByLowercaseString_; } 91 85 /// Returns the map that stores all Identifiers with their IDs. 92 static inline const std::map<uint32_t, Identifier*>& getIDIdentifierMap() 93 { return IdentifierManager::getIDIdentifierMapIntern(); } 94 /// Returns a const_iterator to the beginning of the map that stores all Identifiers with their IDs. 95 static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapBegin() 96 { return IdentifierManager::getIDIdentifierMap().begin(); } 97 /// Returns a const_iterator to the end of the map that stores all Identifiers with their IDs. 98 static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapEnd() 99 { return IdentifierManager::getIDIdentifierMap().end(); } 100 101 protected: 102 static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal); 103 104 /// Returns the map that stores all Identifiers with their names. 105 static std::map<std::string, Identifier*>& getStringIdentifierMapIntern(); 106 /// Returns the map that stores all Identifiers with their names in lowercase. 107 static std::map<std::string, Identifier*>& getLowercaseStringIdentifierMapIntern(); 108 /// Returns the map that stores all Identifiers with their network IDs. 109 static std::map<uint32_t, Identifier*>& getIDIdentifierMapIntern(); 86 inline const std::map<uint32_t, Identifier*>& getIdentifierByNetworkIdMap() 87 { return this->identifierByNetworkId_; } 110 88 111 89 private: 90 IdentifierManager(); 91 IdentifierManager(const IdentifierManager&); 92 ~IdentifierManager() {} 93 112 94 /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents. 113 inline staticvoid startCreatingHierarchy()95 inline void startCreatingHierarchy() 114 96 { hierarchyCreatingCounter_s++; } 115 97 /// Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents. 116 inline staticvoid stopCreatingHierarchy()98 inline void stopCreatingHierarchy() 117 99 { hierarchyCreatingCounter_s--; } 118 100 119 st atic std::map<std::string, Identifier*>& getTypeIDIdentifierMap();101 std::map<std::string, Identifier*> identifierByTypeidName_; //!< Map with the names as received by typeid(). This is only used internally. 120 102 121 static int hierarchyCreatingCounter_s; //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading) 122 static unsigned int classIDCounter_s; //!< Static counter for the unique classIDs 103 std::map<std::string, Identifier*> identifierByString_; //!< Map that stores all Identifiers with their names. 104 std::map<std::string, Identifier*> identifierByLowercaseString_; //!< Map that stores all Identifiers with their names in lowercase. 105 std::map<uint32_t, Identifier*> identifierByNetworkId_; //!< Returns the map that stores all Identifiers with their network IDs. 106 107 int hierarchyCreatingCounter_s; //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading) 108 std::set<const Identifier*> identifiersOfNewObject_; //!< Used while creating the object hierarchy to keep track of the identifiers of a newly created object 109 unsigned int classIDCounter_s; //!< counter for the unique classIDs 123 110 }; 124 111 } -
code/trunk/src/libraries/core/class/OrxonoxClass.h
r9585 r9667 50 50 /** 51 51 @brief This is the class from which all objects of the game-logic (not the engine) are derived from. 52 53 The BaseObject and other classes are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass.54 52 */ 55 53 class _CoreExport OrxonoxClass : virtual public Configurable, virtual public Destroyable 56 54 { 55 public: 56 OrxonoxClass(); 57 57 }; 58 58 } -
code/trunk/src/libraries/core/class/OrxonoxInterface.h
r9585 r9667 50 50 class _CoreExport OrxonoxInterface : virtual public Configurable, virtual public Destroyable 51 51 { 52 public: 53 OrxonoxInterface(); 52 54 }; 53 55 } -
code/trunk/src/libraries/core/class/SubclassIdentifier.h
r9563 r9667 163 163 164 164 /// Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T. 165 T* fabricate( BaseObject* creator) const166 { 167 OrxonoxClass* newObject = this->identifier_->fabricate(creator);165 T* fabricate(Context* context) const 166 { 167 Identifiable* newObject = this->identifier_->fabricate(context); 168 168 169 169 // Check if the creation was successful -
code/trunk/src/libraries/core/class/Super.h
r9568 r9667 103 103 { \ 104 104 ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \ 105 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren Intern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it) \105 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \ 106 106 { \ 107 107 if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \ … … 171 171 172 172 // Iterate through all children 173 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren Intern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)173 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) 174 174 { 175 175 // Check if the caller is a fallback-caller -
code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc
r8858 r9667 39 39 #include "util/Convert.h" 40 40 #include "util/StringUtils.h" 41 #include "core/ Identifier.h"42 #include "core/ ConfigFileManager.h"43 #include "core/ ConfigValueContainer.h"41 #include "core/class/Identifier.h" 42 #include "core/config/SettingsConfigFile.h" 43 #include "core/config/ConfigValueContainer.h" 44 44 #include "CommandExecutor.h" 45 45 #include "ConsoleCommand.h" -
code/trunk/src/libraries/core/command/Functor.h
r9550 r9667 120 120 #include "util/Output.h" 121 121 #include "util/MultiType.h" 122 #include "core/ OrxonoxClass.h"122 #include "core/object/Destroyable.h" 123 123 #include "FunctorPtr.h" 124 124 … … 303 303 /// Casts the object and registers as destruction listener. 304 304 inline void registerObject(O* object) 305 { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->registerAsDestructionListener(base); } }305 { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->registerAsDestructionListener(base); } } 306 306 /// Casts the object and unregisters as destruction listener. 307 307 inline void unregisterObject(O* object) 308 { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->unregisterAsDestructionListener(base); } }309 310 /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted and the Functor is in safe mode.308 { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->unregisterAsDestructionListener(base); } } 309 310 /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode. 311 311 inline void objectDeleted() 312 312 { this->object_ = 0; } -
code/trunk/src/libraries/core/command/IOConsolePOSIX.cc
r9550 r9667 99 99 100 100 resetTerminalMode(); 101 this->shell_->destroy();101 delete this->shell_; 102 102 103 103 // Restore this->cout_ redirection -
code/trunk/src/libraries/core/command/IOConsoleWindows.cc
r9550 r9667 113 113 114 114 resetTerminalMode(); 115 this->shell_->destroy();115 delete this->shell_; 116 116 } 117 117 -
code/trunk/src/libraries/core/command/Shell.cc
r9550 r9667 40 40 #include "util/output/MemoryWriter.h" 41 41 #include "core/CoreIncludes.h" 42 #include "core/ ConfigFileManager.h"43 #include "core/ ConfigValueIncludes.h"42 #include "core/config/ConfigFileManager.h" 43 #include "core/config/ConfigValueIncludes.h" 44 44 #include "core/PathConfig.h" 45 45 #include "core/input/InputBuffer.h" … … 55 55 const OutputLevel User = level::user_info; 56 56 } 57 58 RegisterClassNoArgs(Shell); 57 59 58 60 /** … … 66 68 , bScrollable_(bScrollable) 67 69 { 68 Register RootObject(Shell);70 RegisterObject(Shell); 69 71 70 72 OutputManager::getInstance().registerListener(this); … … 96 98 Shell::~Shell() 97 99 { 98 this->inputBuffer_->destroy();100 delete this->inputBuffer_; 99 101 100 102 OutputManager::getInstance().unregisterListener(this); -
code/trunk/src/libraries/core/command/Shell.h
r8858 r9667 50 50 #include "util/output/BaseWriter.h" 51 51 #include "core/Core.h" 52 #include "core/OrxonoxClass.h"53 52 54 53 namespace orxonox … … 110 109 }; 111 110 112 Shell(const std::string& consoleName , bool bScrollable);111 Shell(const std::string& consoleName = "", bool bScrollable = true); 113 112 ~Shell(); 114 113 … … 200 199 unsigned int historyOffset_; ///< The command history is a circular buffer, this variable defines the current write-offset 201 200 std::vector<std::string> commandHistory_; ///< The history of commands that were entered by the user 202 static unsigned int cacheSize_s; ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass201 static unsigned int cacheSize_s; ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is not configurable 203 202 }; 204 203 } -
code/trunk/src/libraries/core/config/CMakeLists.txt
r9560 r9667 6 6 ConfigFileManager.cc 7 7 ConfigFileSection.cc 8 Configurable.cc 8 9 ConfigValueContainer.cc 9 10 SettingsConfigFile.cc -
code/trunk/src/libraries/core/config/ConfigValueContainer.h
r9564 r9667 70 70 inline virtual void call(void* object) 71 71 { 72 if (!IdentifierManager:: isCreatingHierarchy())72 if (!IdentifierManager::getInstance().isCreatingHierarchy()) 73 73 (static_cast<T*>(object)->*this->function_)(); 74 74 } -
code/trunk/src/libraries/core/config/Configurable.h
r9577 r9667 48 48 { 49 49 public: 50 Configurable(); 51 50 52 /// Function to collect the SetConfigValue-macro calls. 51 53 void setConfigValues() {}; -
code/trunk/src/libraries/core/input/Button.cc
r8858 r9667 42 42 #include "core/command/CommandEvaluation.h" 43 43 #include "core/command/CommandExecutor.h" 44 #include "core/ ConfigFileManager.h"44 #include "core/config/ConfigFile.h" 45 45 46 46 namespace orxonox -
code/trunk/src/libraries/core/input/InputBuffer.cc
r6417 r9667 31 31 #include "util/Clipboard.h" 32 32 #include "core/CoreIncludes.h" 33 #include "core/ ConfigValueIncludes.h"33 #include "core/config/ConfigValueIncludes.h" 34 34 35 35 namespace orxonox 36 36 { 37 RegisterClassNoArgs(InputBuffer); 38 37 39 InputBuffer::InputBuffer() 38 40 { 39 Register RootObject(InputBuffer);41 RegisterObject(InputBuffer); 40 42 41 43 this->cursor_ = 0; … … 57 59 InputBuffer::InputBuffer(const std::string& allowedChars) 58 60 { 59 Register RootObject(InputBuffer);61 RegisterObject(InputBuffer); 60 62 61 63 this->maxLength_ = 1024; -
code/trunk/src/libraries/core/input/InputBuffer.h
r6417 r9667 34 34 #include <list> 35 35 #include <string> 36 #include "core/ OrxonoxClass.h"36 #include "core/config/Configurable.h" 37 37 #include "InputHandler.h" 38 38 … … 74 74 }; 75 75 76 class _CoreExport InputBuffer : public InputHandler, public OrxonoxClass76 class _CoreExport InputBuffer : public InputHandler, public Configurable 77 77 { 78 78 public: -
code/trunk/src/libraries/core/input/InputManager.cc
r9550 r9667 46 46 #include "util/Exception.h" 47 47 #include "core/CoreIncludes.h" 48 #include "core/ConfigValueIncludes.h"49 #include "core/CommandLineParser.h"50 48 #include "core/GraphicsManager.h" 49 #include "core/config/ConfigValueIncludes.h" 50 #include "core/config/CommandLineParser.h" 51 51 #include "core/command/ConsoleCommand.h" 52 52 #include "core/command/Functor.h" … … 98 98 , calibratorCallbackHandler_(0) 99 99 { 100 Register RootObject(InputManager);100 RegisterObject(InputManager); 101 101 102 102 orxout(internal_status, context::input) << "InputManager: Constructing..." << endl; … … 280 280 this->destroyState("calibrator"); 281 281 // Destroy KeyDetector and state 282 calibratorCallbackHandler_->destroy();282 delete calibratorCallbackHandler_; 283 283 // Destroy the empty InputState 284 284 this->destroyStateInternal(this->emptyState_); … … 642 642 assert(state && this->activeStates_.find(state->getPriority()) == this->activeStates_.end()); 643 643 statesByName_.erase(state->getName()); 644 state->destroy();644 delete state; 645 645 } 646 646 -
code/trunk/src/libraries/core/input/JoyStick.cc
r8858 r9667 34 34 35 35 #include "util/StringUtils.h" 36 #include "core/ConfigFileManager.h" 37 #include "core/ConfigValueIncludes.h" 36 #include "core/config/ConfigFile.h" 37 #include "core/config/ConfigFileManager.h" 38 #include "core/config/ConfigValueIncludes.h" 38 39 #include "core/CoreIncludes.h" 39 40 #include "util/Convert.h" … … 50 51 : super(id, oisInputManager) 51 52 { 52 Register RootObject(JoyStick);53 RegisterObject(JoyStick); 53 54 this->setConfigValues(); 54 55 // Initialise POV and Slider states -
code/trunk/src/libraries/core/input/JoyStick.h
r8729 r9667 36 36 #include <ois/OISJoyStick.h> 37 37 #include "InputDevice.h" 38 #include "core/config/Configurable.h" 38 39 39 40 namespace orxonox … … 58 59 */ 59 60 class _CoreExport JoyStick 60 : public OrxonoxClass61 : public Configurable 61 62 , public InputDeviceTemplated<JoyStickTraits> 62 63 , public OIS::JoyStickListener -
code/trunk/src/libraries/core/input/JoyStickQuantityListener.cc
r5781 r9667 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/ ObjectList.h"32 #include "core/object/ObjectList.h" 33 33 34 34 namespace orxonox -
code/trunk/src/libraries/core/input/JoyStickQuantityListener.h
r8729 r9667 38 38 39 39 #include <vector> 40 #include "core/ OrxonoxClass.h"40 #include "core/object/Listable.h" 41 41 42 42 namespace orxonox 43 43 { 44 44 //! Derive from this class to get informed when joy sticks get added/removed 45 class _CoreExport JoyStickQuantityListener : virtual public OrxonoxClass45 class _CoreExport JoyStickQuantityListener : virtual public Listable 46 46 { 47 47 friend class InputManager; -
code/trunk/src/libraries/core/input/KeyBinder.cc
r8858 r9667 34 34 #include "util/Output.h" 35 35 #include "util/Exception.h" 36 #include "core/ConfigValueIncludes.h"37 36 #include "core/CoreIncludes.h" 38 #include "core/ConfigFileManager.h" 37 #include "core/config/ConfigValueIncludes.h" 38 #include "core/config/ConfigFile.h" 39 39 #include "core/PathConfig.h" 40 40 #include "InputCommands.h" … … 58 58 mousePosition_[1] = 0.0; 59 59 60 Register RootObject(KeyBinder);60 RegisterObject(KeyBinder); 61 61 62 62 // initialise all buttons and half axes to avoid creating everything with 'new' -
code/trunk/src/libraries/core/input/KeyBinderManager.cc
r8858 r9667 32 32 #include "util/Exception.h" 33 33 #include "util/ScopedSingletonManager.h" 34 #include "core/ ConfigValueIncludes.h"34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/CoreIncludes.h" 36 36 #include "core/LuaState.h" -
code/trunk/src/libraries/core/input/KeyBinderManager.h
r8729 r9667 36 36 37 37 #include "util/Singleton.h" 38 #include "core/ OrxonoxClass.h"38 #include "core/config/Configurable.h" 39 39 40 40 namespace orxonox //tolua_export … … 53 53 */ 54 54 class _CoreExport KeyBinderManager //tolua_export 55 : public Singleton<KeyBinderManager>, public OrxonoxClass55 : public Singleton<KeyBinderManager>, public Configurable 56 56 { //tolua_export 57 57 friend class Singleton<KeyBinderManager>; -
code/trunk/src/libraries/core/input/Mouse.cc
r8729 r9667 54 54 : super(id, oisInputManager) 55 55 { 56 Register RootObject(Mouse);56 RegisterObject(Mouse); 57 57 this->windowResized(this->getWindowWidth(), this->getWindowHeight()); 58 58 -
code/trunk/src/libraries/core/object/CMakeLists.txt
r9591 r9667 3 3 Destroyable.cc 4 4 Listable.cc 5 MetaObjectList.cc6 5 ObjectListBase.cc 7 6 ) -
code/trunk/src/libraries/core/object/ClassFactory.h
r9563 r9667 43 43 44 44 #include "util/Output.h" 45 #include "core/class/Identifier.h"46 45 47 46 namespace orxonox … … 50 49 // ### Factory ### 51 50 // ########################### 52 /// Base-class of ClassFactory.51 /// Base-class of all factories. 53 52 class _CoreExport Factory 54 53 { 55 54 public: 56 virtual ~Factory() {} ;57 virtual OrxonoxClass* fabricate(BaseObject* creator) = 0;55 virtual ~Factory() {} 56 virtual Identifiable* fabricate(Context* context) = 0; 58 57 }; 59 58 … … 61 60 // ### ClassFactory ### 62 61 // ############################### 63 /// The ClassFactory is able to create new objects of a specific class.62 /// The ClassFactory is the base-class of all class-spezific factories 64 63 template <class T> 65 64 class ClassFactory : public Factory 66 65 { 66 }; 67 68 // ############################### 69 // ### ClassFactoryNoArgs ### 70 // ############################### 71 /// The ClassFactoryNoArgs is able to create new objects of a specific class that require no constructor arguments. 72 template <class T> 73 class ClassFactoryNoArgs : public ClassFactory<T> 74 { 67 75 public: 68 /**69 @brief Constructor: Adds the ClassFactory to the Identifier of the same type.70 @param name The name of the class71 @param bLoadable True if the class can be loaded through XML72 */73 ClassFactory(const std::string& name, bool bLoadable = true)74 {75 orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;76 ClassIdentifier<T>::getIdentifier(name)->addFactory(this);77 ClassIdentifier<T>::getIdentifier()->setLoadable(bLoadable);78 }79 80 76 /** 81 77 @brief Creates and returns a new object of class T. 82 78 @return The new object 83 79 */ 84 inline OrxonoxClass* fabricate(BaseObject* creator)80 inline Identifiable* fabricate(Context* context) 85 81 { 86 return static_cast<OrxonoxClass*>(new T(creator)); 82 return static_cast<Identifiable*>(new T()); 83 } 84 }; 85 86 // ############################### 87 // ### ClassFactoryWithContext ### 88 // ############################### 89 /// The ClassFactoryWithContext is able to create new objects of a specific class that require a context as constructor argument 90 template <class T> 91 class ClassFactoryWithContext : public ClassFactory<T> 92 { 93 public: 94 /** 95 @brief Creates and returns a new object of class T. 96 @return The new object 97 */ 98 inline Identifiable* fabricate(Context* context) 99 { 100 return static_cast<Identifiable*>(new T(context)); 87 101 } 88 102 }; -
code/trunk/src/libraries/core/object/Context.cc
r9591 r9667 33 33 34 34 #include "Context.h" 35 #include "core/class/Identifier.h" 36 #include "core/CoreIncludes.h" 35 37 36 38 namespace orxonox 37 39 { 38 Context::Context(Context* context) : parentContext_(context) 40 RegisterClass(Context); 41 42 Context* Context::rootContext_s = 0; 43 44 Context* getContextForInitializationOfOtherContexts() 39 45 { 46 static size_t count = 0; 47 // the first time this is called, ++count returns 1 and the context is created 48 // the second time this is called, ++count returns 2 and NULL is returned because we're in the constructor of the context itself 49 // for each future call the context (now completely created) is returned 50 if (++count == 2) 51 return NULL; 52 else 53 { 54 static Context context(NULL); 55 return &context; 56 } 57 } 58 59 // Initialize Listable(*) with a special context, only used to initialize other contexts. Later in the constructor we change the context 60 Context::Context(Context* context) : Listable(getContextForInitializationOfOtherContexts()), parentContext_(context) 61 { 62 RegisterObject(Context); 63 64 // the context is its own context 65 this->setContext(this); 40 66 } 41 67 42 68 Context::~Context() 43 69 { 70 // unregister context from object lists before object lists are destroyed 71 this->unregisterObject(); 72 for (size_t i = 0; i < this->objectLists_.size(); ++i) 73 delete this->objectLists_[i]; 74 } 75 76 /*static*/ void Context::setRootContext(Context* context) 77 { 78 if (Context::rootContext_s) 79 delete Context::rootContext_s; 80 Context::rootContext_s = context; 44 81 } 45 82 46 83 /*static*/ Context* Context::getRootContext() 47 84 { 48 static Context rootContext(NULL); 49 return &rootContext; 85 if (!Context::rootContext_s) 86 Context::rootContext_s = new Context(NULL); 87 return Context::rootContext_s; 88 } 89 90 ObjectListBase* Context::getObjectList(const Identifier* identifier) 91 { 92 unsigned int classID = identifier->getClassID(); 93 if (classID >= this->objectLists_.size()) 94 this->objectLists_.resize(classID + 1); 95 if (!this->objectLists_[classID]) 96 this->objectLists_[classID] = new ObjectListBase(); 97 return this->objectLists_[classID]; 50 98 } 51 99 } -
code/trunk/src/libraries/core/object/Context.h
r9591 r9667 37 37 #include "core/CorePrereqs.h" 38 38 39 #include <vector> 40 41 #include "Listable.h" 42 39 43 namespace orxonox 40 44 { 41 class _CoreExport Context 45 class _CoreExport Context : virtual public Listable 42 46 { 43 47 public: 48 static void setRootContext(Context* context); 49 static Context* getRootContext(); 50 44 51 Context(Context* context); 45 52 virtual ~Context(); … … 48 55 { return this->parentContext_; } 49 56 50 static Context* getRootContext(); 57 ObjectListBase* getObjectList(const Identifier* identifier); 58 59 template <class T> 60 inline ObjectListBase* getObjectList() 61 { return this->getObjectList(ClassIdentifier<T>::getIdentifier()); } 62 63 template <class T> 64 inline void addObject(T* object) 65 { 66 ObjectListBaseElement* element = Listable::createObjectListElement(object); 67 this->getObjectList<T>()->addElement(element); 68 object->elements_.push_back(element); 69 if (this->getParentContext()) 70 this->getParentContext()->addObject(object); 71 } 51 72 52 73 private: 53 74 Context* parentContext_; 75 std::vector<ObjectListBase*> objectLists_; 76 77 static Context* rootContext_s; 54 78 }; 55 79 } -
code/trunk/src/libraries/core/object/Iterator.h
r9573 r9667 56 56 #include "core/CorePrereqs.h" 57 57 58 #include "core/class/Identifier.h"59 58 #include "ObjectListBase.h" 59 #include "IteratorBase.h" 60 60 61 61 namespace orxonox … … 70 70 */ 71 71 template <class T> 72 class Iterator 72 class Iterator : public IteratorBase<T, Iterator<T> > 73 73 { 74 74 public: … … 76 76 @brief Constructor: Sets the element, whereon the iterator points, to zero. 77 77 */ 78 inline Iterator() 79 { 80 this->element_ = 0; 81 this->list_ = 0; 82 } 78 inline Iterator() : IteratorBase<T, Iterator<T> >(NULL) {} 83 79 84 80 /** 85 @brief Constructor: Sets this element to the exported element.86 @param e xp The exportedelement81 @brief Constructor: Sets this element to a given element 82 @param element The element 87 83 */ 88 inline Iterator(const ObjectListBase::Export& exp) 89 { 90 this->element_ = exp.element_; 91 this->list_ = exp.list_; 92 this->list_->registerIterator(this); 93 } 84 inline Iterator(ObjectListBaseElement* element) : IteratorBase<T, Iterator<T> >(element) {} 94 85 95 86 /** … … 97 88 @param other The other Iterator 98 89 */ 99 inline Iterator(const Iterator<T>& other) 100 { 101 this->element_ = other.element_; 102 this->list_ = other.list_; 103 this->list_->registerIterator(this); 104 } 105 106 /** 107 @brief Constructor: Sets this element to a given element 108 @param element The element 109 */ 110 template <class O> 111 inline Iterator(ObjectListElement<O>* element) 112 { 113 this->element_ = element; 114 this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects(); 115 this->list_->registerIterator(this); 116 } 117 118 /** 119 @brief Constructor: Sets this element to the element an ObjectListIterator. 120 @param other The ObjectListIterator 121 */ 122 template <class O> 123 inline Iterator(const ObjectListIterator<O>& other) 124 { 125 this->element_ = other.element_; 126 this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects(); 127 this->list_->registerIterator(this); 128 } 129 130 /** 131 @brief Unregisters the Iterator from the ObjectList. 132 */ 133 inline ~Iterator() 134 { 135 this->list_->unregisterIterator(this); 136 } 137 138 /** 139 @brief Assigns an exported element. 140 @param exp The exported element 141 */ 142 inline Iterator<T>& operator=(const ObjectListBase::Export& exp) 143 { 144 if (this->list_) 145 this->list_->unregisterIterator(this); 146 147 this->element_ = exp.element_; 148 this->list_ = exp.list_; 149 this->list_->registerIterator(this); 150 151 return (*this); 152 } 153 154 /** 155 @brief Assigns the element of another Iterator. 156 @param other The other Iterator 157 */ 158 inline Iterator<T>& operator=(const Iterator<T>& other) 159 { 160 if (this->list_) 161 this->list_->unregisterIterator(this); 162 163 this->element_ = other.element_; 164 this->list_ = other.list_; 165 this->list_->registerIterator(this); 166 167 return (*this); 168 } 90 inline Iterator(const Iterator<T>& other) : IteratorBase<T, Iterator<T> >(other) {} 169 91 170 92 /** … … 172 94 @param element The element 173 95 */ 174 template <class O> 175 inline Iterator<T>& operator=(ObjectListElement<O>* element) 96 inline Iterator<T>& operator=(ObjectListBaseElement* element) 176 97 { 177 if (this->list_) 178 this->list_->unregisterIterator(this); 179 180 this->element_ = element; 181 this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects(); 182 this->list_->registerIterator(this); 183 98 this->setElement(element); 184 99 return (*this); 185 }186 187 /**188 @brief Assigns the element of an ObjectListIterator.189 @param other The ObjectListIterator190 */191 template <class O>192 inline Iterator<T>& operator=(const ObjectListIterator<O>& other)193 {194 if (this->list_)195 this->list_->unregisterIterator(this);196 197 this->element_ = other.element_;198 this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();199 this->list_->registerIterator(this);200 201 return (*this);202 }203 204 /**205 @brief Overloading of the ++it operator: Iterator points to the next object in the list.206 @return The Iterator itself207 */208 inline const Iterator<T>& operator++()209 {210 this->element_ = this->element_->next_;211 return *this;212 }213 214 /**215 @brief Overloading of the it++ operator: Iterator points to the next object in the list.216 @return The Iterator itself217 */218 inline Iterator<T> operator++(int)219 {220 Iterator<T> copy = *this;221 this->element_ = this->element_->next_;222 return copy;223 }224 225 /**226 @brief Overloading of the --it operator: Iterator points to the previous object in the list.227 @return The Iterator itself228 */229 inline const Iterator<T>& operator--()230 {231 this->element_ = this->element_->prev_;232 return *this;233 }234 235 /**236 @brief Overloading of the it-- operator: Iterator points to the previous object in the list.237 @return The Iterator itself238 */239 inline Iterator<T> operator--(int i)240 {241 Iterator<T> copy = *this;242 this->element_ = this->element_->prev_;243 return copy;244 100 } 245 101 … … 261 117 return orxonox_cast<T*>(this->element_->objectBase_); 262 118 } 263 264 /**265 @brief Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.266 @return True if the Iterator points to an existing object.267 */268 inline operator bool() const269 {270 return (this->element_ != 0);271 }272 273 /**274 @brief Overloading of the == operator to compare with another Iterator.275 @param compare The other Iterator276 @return True if the iterators point to the same element277 */278 inline bool operator==(const Iterator<T>& compare) const279 {280 return (this->element_ == compare.element_);281 }282 283 /**284 @brief Overloading of the != operator to compare with another Iterator.285 @param compare The other Iterator286 @return True if the iterators point to different elements287 */288 inline bool operator!=(const Iterator<T>& compare) const289 {290 return (this->element_ != compare.element_);291 }292 293 /**294 @brief Increments the Iterator if it points at the given object.295 @param object The object to compare with296 */297 inline void incrementIfEqual(Listable* object)298 {299 if (this->element_ && this->element_->objectBase_ == object)300 this->operator++();301 }302 303 protected:304 ObjectListBaseElement* element_; //!< The element the Iterator points at305 ObjectListBase* list_; //!< The list wherein the element is306 119 }; 307 120 } -
code/trunk/src/libraries/core/object/Listable.cc
r9572 r9667 33 33 34 34 #include "Listable.h" 35 36 #include "core/object/MetaObjectList.h" 35 #include "core/CoreIncludes.h" 36 #include "ObjectListBase.h" 37 #include "Context.h" 37 38 38 39 namespace orxonox 39 40 { 41 RegisterClass(Listable); 42 40 43 /** 41 @brief Constructor: creates the meta-object-list.44 @brief Constructor: Allocates space in the element list. 42 45 */ 43 46 Listable::Listable() 44 47 { 45 this->metaList_ = new MetaObjectList(); 48 this->context_ = Context::getRootContext(); 49 this->elements_.reserve(6); 50 51 RegisterObject(Listable); 52 } 53 54 /** 55 @brief Constructor: Allocates space in the element list and assigns the context 56 */ 57 Listable::Listable(Context* context) 58 { 59 this->context_ = context; 60 this->elements_.reserve(6); 61 62 RegisterObject(Listable); 46 63 } 47 64 … … 59 76 void Listable::unregisterObject() 60 77 { 61 if (this->metaList_) 62 delete this->metaList_; 63 this->metaList_ = 0; 78 for (size_t i = 0; i < this->elements_.size(); ++i) 79 Listable::deleteObjectListElement(this->elements_[i]); 80 this->elements_.clear(); 81 } 82 83 /** 84 * @brief Changes the context. 85 * The object is removed from the current context and added to the new one. This also applies to all object lists the object is registered in. 86 */ 87 void Listable::setContext(Context* context) 88 { 89 assert(context); 90 std::vector<ObjectListBaseElement*> copy = this->elements_; 91 this->elements_.clear(); 92 93 for (size_t i = 0; i < copy.size(); ++i) 94 { 95 copy[i]->changeContext(this->context_, context); 96 Listable::deleteObjectListElement(copy[i]); 97 } 98 99 this->context_ = context; 100 } 101 102 /* static */ SmallObjectAllocator& Listable::getObjectListElementAllocator() 103 { 104 static SmallObjectAllocator allocator(sizeof(ObjectListElement<Listable>), 1024); 105 return allocator; 106 } 107 108 /* static */ void Listable::deleteObjectListElement(ObjectListBaseElement* element) 109 { 110 element->~ObjectListBaseElement(); 111 Listable::getObjectListElementAllocator().free(element); 64 112 } 65 113 } -
code/trunk/src/libraries/core/object/Listable.h
r9572 r9667 37 37 38 38 #include "core/CorePrereqs.h" 39 40 #include <vector> 41 39 42 #include "core/class/Identifiable.h" 40 43 … … 42 45 { 43 46 /** 44 @brief Listable stores the MetaObjectList which is used when storing instances in object lists.47 @brief Listable stores the entries of all object lists pointing to this instance. 45 48 */ 46 49 class _CoreExport Listable : virtual public Identifiable 47 50 { 48 template <class T> 49 friend class ClassIdentifier; 51 friend class Context; 50 52 51 53 public: 52 54 Listable(); 55 Listable(Context* context); 53 56 virtual ~Listable(); 54 57 55 58 void unregisterObject(); 56 59 60 void setContext(Context* context); 61 inline Context* getContext() const 62 { return this->context_; } 63 57 64 private: 58 MetaObjectList* metaList_; //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in 65 static SmallObjectAllocator& getObjectListElementAllocator(); 66 67 template <class T> 68 static ObjectListElement<T>* createObjectListElement(T* object) 69 { 70 void* chunk = Listable::getObjectListElementAllocator().alloc(); 71 return new (chunk) ObjectListElement<T>(object); 72 } 73 74 static void deleteObjectListElement(ObjectListBaseElement* element); 75 76 Context* context_; //!< The object will register itself in the object lists of this context 77 std::vector<ObjectListBaseElement*> elements_; //!< The corresponding ObjectListElements in all object lists the object is registered in 59 78 }; 60 79 } -
code/trunk/src/libraries/core/object/ObjectList.h
r9557 r9667 49 49 #include "ObjectListBase.h" 50 50 #include "ObjectListIterator.h" 51 #include "Context.h" 51 52 52 53 namespace orxonox … … 68 69 typedef ObjectListIterator<T> iterator; 69 70 71 /// Returns the size of the list 72 inline static size_t size() 73 { 74 return Context::getRootContext()->getObjectList<T>()->size(); 75 } 76 70 77 /// Returns an Iterator to the first element in the list. 71 78 inline static ObjectListElement<T>* begin() 72 79 { 73 ObjectListBase* list = C lassIdentifier<T>::getIdentifier()->getObjects();74 return static_cast<ObjectListElement<T>*>(list->begin() .element_);80 ObjectListBase* list = Context::getRootContext()->getObjectList<T>(); 81 return static_cast<ObjectListElement<T>*>(list->begin()); 75 82 } 76 83 … … 78 85 inline static ObjectListElement<T>* end() 79 86 { 80 ObjectListBase* list = C lassIdentifier<T>::getIdentifier()->getObjects();81 return static_cast<ObjectListElement<T>*>(list->end() .element_);87 ObjectListBase* list = Context::getRootContext()->getObjectList<T>(); 88 return static_cast<ObjectListElement<T>*>(list->end()); 82 89 } 83 90 … … 85 92 inline static ObjectListElement<T>* rbegin() 86 93 { 87 ObjectListBase* list = C lassIdentifier<T>::getIdentifier()->getObjects();88 return static_cast<ObjectListElement<T>*>(list->rbegin() .element_);94 ObjectListBase* list = Context::getRootContext()->getObjectList<T>(); 95 return static_cast<ObjectListElement<T>*>(list->rbegin()); 89 96 } 90 97 … … 92 99 inline static ObjectListElement<T>* rend() 93 100 { 94 ObjectListBase* list = C lassIdentifier<T>::getIdentifier()->getObjects();95 return static_cast<ObjectListElement<T>*>(list->rend() .element_);101 ObjectListBase* list = Context::getRootContext()->getObjectList<T>(); 102 return static_cast<ObjectListElement<T>*>(list->rend()); 96 103 } 97 104 }; -
code/trunk/src/libraries/core/object/ObjectListBase.cc
r9593 r9667 41 41 namespace orxonox 42 42 { 43 // ############################### 44 // ### ObjectListBaseElement ### 45 // ############################### 46 void ObjectListBaseElement::removeFromList() 47 { 48 if (this->list_) 49 this->list_->removeElement(this); 50 } 51 52 // ############################### 53 // ### ObjectListBase ### 54 // ############################### 43 55 /** 44 56 @brief Constructor: Sets default values. … … 48 60 this->first_ = 0; 49 61 this->last_ = 0; 62 this->size_ = 0; 50 63 } 51 64 … … 55 68 ObjectListBase::~ObjectListBase() 56 69 { 57 ObjectListBaseElement* temp;58 while ( this->first_)70 ObjectListBaseElement* current = this->first_; 71 while (current) 59 72 { 60 temp = this->first_->next_; 61 delete this->first_; 62 this->first_ = temp; 73 ObjectListBaseElement* next = current->next_; 74 75 current->list_ = 0; 76 current->next_ = 0; 77 current->prev_ = 0; 78 79 current = next; 63 80 } 64 81 } 65 82 66 83 /** 67 @brief Increases all Iterators that currently point on the given element (because it gets removed). 68 @param object The object that gets removed 84 @brief Notifies all listeners that the given element is about to get removed. 85 @param element The element that gets removed 86 This is mainly used for iterators which point at the removed element 69 87 */ 70 void ObjectListBase::notify Iterators(Listable* object) const88 void ObjectListBase::notifyRemovalListeners(ObjectListBaseElement* element) const 71 89 { 72 for (std::vector<void*>::const_iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it) 73 ((Iterator<Listable>*)(*it))->incrementIfEqual(object); 74 for (std::vector<void*>::const_iterator it = this->objectListIterators_.begin(); it != this->objectListIterators_.end(); ++it) 75 ((ObjectListIterator<Listable>*)(*it))->incrementIfEqual(object); 90 for (std::vector<ObjectListElementRemovalListener*>::const_iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it) 91 (*it)->removedElement(element); 76 92 } 77 93 … … 79 95 @brief Adds a new object to the end of the list. 80 96 @param element The element to add 81 @return The pointer to the new ObjectListBaseElement, needed by the MetaObjectList of the added object82 97 */ 83 ObjectListBaseElement*ObjectListBase::addElement(ObjectListBaseElement* element)98 void ObjectListBase::addElement(ObjectListBaseElement* element) 84 99 { 100 if (element->list_) 101 { 102 orxout(internal_error) << "Element is already registered in another list" << endl; 103 return; 104 } 105 106 if (element->objectBase_) 107 orxout(verbose, context::object_list) << "Added object to " << element->objectBase_->getIdentifier()->getName() << "-list." << endl; 108 85 109 if (!this->last_) 86 110 { 87 111 // If the list is empty 88 112 this->last_ = element; 89 this->first_ = this->last_; // There's only one object in the list now113 this->first_ = element; // There's only one object in the list now 90 114 } 91 115 else … … 94 118 ObjectListBaseElement* temp = this->last_; 95 119 this->last_ = element; 96 this->last_->prev_ = temp;97 temp->next_ = this->last_;120 element->prev_ = temp; 121 temp->next_ = element; 98 122 } 99 123 100 return this->last_; 124 element->list_ = this; 125 ++this->size_; 101 126 } 102 127 128 /** 129 * @brief Removes the element from the list 130 */ 103 131 void ObjectListBase::removeElement(ObjectListBaseElement* element) 104 132 { 105 orxout(verbose, context::object_list) << "Removing Object from " << element->objectBase_->getIdentifier()->getName() << "-list." << endl; 106 this->notifyIterators(element->objectBase_); 133 if (element->list_ != this) 134 { 135 orxout(internal_error) << "Element is not registered in this list" << endl; 136 return; 137 } 138 139 if (element->objectBase_) 140 orxout(verbose, context::object_list) << "Removing Object from " << element->objectBase_->getIdentifier()->getName() << "-list." << endl; 141 this->notifyRemovalListeners(element); 107 142 108 143 if (element->next_) … … 115 150 else 116 151 this->first_ = element->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list 152 153 element->list_ = 0; 154 element->next_ = 0; 155 element->prev_ = 0; 156 --this->size_; 117 157 } 118 158 } -
code/trunk/src/libraries/core/object/ObjectListBase.h
r9593 r9667 42 42 #include "core/CorePrereqs.h" 43 43 #include <vector> 44 #include "Context.h" 44 45 45 46 namespace orxonox … … 56 57 @param objectBase The object to store 57 58 */ 58 ObjectListBaseElement(Listable* objectBase) : next_(0), prev_(0), objectBase_(objectBase) {} 59 ObjectListBaseElement(Listable* object) : next_(0), prev_(0), objectBase_(object), list_(0) {} 60 virtual ~ObjectListBaseElement() { this->removeFromList(); } 61 62 virtual void changeContext(Context* oldContext, Context* newContext) = 0; 59 63 60 64 ObjectListBaseElement* next_; //!< The next element in the list 61 65 ObjectListBaseElement* prev_; //!< The previous element in the list 62 Listable* objectBase_; 66 Listable* objectBase_; //!< The object 67 ObjectListBase* list_; //!< The list 68 69 protected: 70 void removeFromList(); 63 71 }; 64 72 … … 73 81 public: 74 82 ObjectListElement(T* object) : ObjectListBaseElement(static_cast<Listable*>(object)), object_(object) {} 83 84 virtual void changeContext(Context* oldContext, Context* newContext) 85 { 86 // add object to new context, but only if this element belongs exactly to the old context (and not to a sub-context to avoid re-adding objects 87 // multiple times if they are in multiple contexts) 88 if (oldContext->getObjectList<T>() == this->list_) 89 newContext->addObject(this->object_); 90 91 // remove from old list 92 this->removeFromList(); 93 } 94 75 95 T* object_; //!< The object 76 96 }; 77 97 98 99 // ######################################## 100 // ### ObjectListElementRemovalListener ### 101 // ######################################## 102 /// Gets called by the object list if an element is removed 103 class _CoreExport ObjectListElementRemovalListener 104 { 105 public: 106 virtual ~ObjectListElementRemovalListener() {} 107 virtual void removedElement(ObjectListBaseElement* element) = 0; 108 }; 78 109 79 110 // ############################### … … 97 128 ~ObjectListBase(); 98 129 99 template <class T> 100 inline ObjectListBaseElement* add(T* object) 101 { return this->addElement(new ObjectListElement<T>(object)); } 102 103 ObjectListBaseElement* addElement(ObjectListBaseElement* element); 130 void addElement(ObjectListBaseElement* element); 104 131 void removeElement(ObjectListBaseElement* element); 105 132 106 /// Helper struct, used to export an element and the list to an instance of Iterator. 107 struct Export 108 { 109 Export(ObjectListBase* list, ObjectListBaseElement* element) : list_(list), element_(element) {} 110 ObjectListBase* list_; 111 ObjectListBaseElement* element_; 112 }; 133 size_t size() const { return this->size_; } 113 134 114 135 /// Returns a pointer to the first element in the list. Works only with Iterator. 115 inline Export begin() { return ObjectListBase::Export(this, this->first_); }136 inline ObjectListBaseElement* begin() const { return this->first_; } 116 137 /// Returns a pointer to the element after the last element in the list. Works only with Iterator. 117 inline Export end() { return ObjectListBase::Export(this, 0); }138 inline ObjectListBaseElement* end() const { return 0; } 118 139 /// Returns a pointer to the last element in the list. Works only with Iterator. 119 inline Export rbegin() { return ObjectListBase::Export(this, this->last_); }140 inline ObjectListBaseElement* rbegin() const { return this->last_; } 120 141 /// Returns a pointer to the element in front of the first element in the list. Works only with Iterator. 121 inline Export rend() { return ObjectListBase::Export(this, 0); }142 inline ObjectListBaseElement* rend() const { return 0; } 122 143 123 inline void register Iterator(void* iterator) { this->iterators_.push_back(iterator); }124 inline void unregister Iterator(void* iterator)144 inline void registerRemovalListener(ObjectListElementRemovalListener* listener) { this->listeners_.push_back(listener); } 145 inline void unregisterRemovalListener(ObjectListElementRemovalListener* listener) 125 146 { 126 for (unsigned int i = 0; i < this-> iterators_.size(); ++i)147 for (unsigned int i = 0; i < this->listeners_.size(); ++i) 127 148 { 128 if ( iterators_[i] == iterator)149 if (listeners_[i] == listener) 129 150 { 130 iterators_.erase(iterators_.begin() + i);151 listeners_.erase(listeners_.begin() + i); 131 152 break; 132 153 } 133 154 } 134 155 } 135 inline void registerObjectListIterator(void* iterator) { this->objectListIterators_.push_back(iterator); }136 inline void unregisterObjectListIterator(void* iterator)137 {138 for (unsigned int i = 0; i < this->objectListIterators_.size(); ++i)139 {140 if (objectListIterators_[i] == iterator)141 {142 objectListIterators_.erase(objectListIterators_.begin() + i);143 break;144 }145 }146 }147 void notifyIterators(Listable* object) const;148 156 149 157 private: 150 ObjectListBaseElement* first_; //!< The first element in the list 151 ObjectListBaseElement* last_; //!< The last element in the list 152 std::vector<void*> iterators_; //!< A list of Iterators pointing on an element in this list 153 std::vector<void*> objectListIterators_; //!< A list of ObjectListIterators pointing on an element in this list 158 void notifyRemovalListeners(ObjectListBaseElement* element) const; 159 160 ObjectListBaseElement* first_; //!< The first element in the list 161 ObjectListBaseElement* last_; //!< The last element in the list 162 size_t size_; //!< The number of elements in the list 163 std::vector<ObjectListElementRemovalListener*> listeners_; //!< A list of Iterators pointing on an element in this list 154 164 }; 155 165 } -
code/trunk/src/libraries/core/object/ObjectListIterator.h
r9573 r9667 58 58 #include "core/class/Identifier.h" 59 59 #include "ObjectList.h" 60 #include "IteratorBase.h" 60 61 61 62 namespace orxonox … … 67 68 */ 68 69 template <class T> 69 class ObjectListIterator 70 class ObjectListIterator : public IteratorBase<T, ObjectListIterator<T> > 70 71 { 71 template <class I>72 friend class Iterator;73 74 72 public: 75 73 /** 76 74 @brief Constructor: Sets the element, whereon the ObjectListIterator points, to zero. 77 75 */ 78 inline ObjectListIterator() 79 { 80 this->element_ = 0; 81 ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this); 82 } 76 inline ObjectListIterator() : IteratorBase<T, ObjectListIterator<T> >(NULL) {} 83 77 84 78 /** … … 86 80 @param element The element to start with 87 81 */ 88 inline ObjectListIterator(ObjectListElement<T>* element) 89 { 90 this->element_ = element; 91 ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this); 92 } 82 inline ObjectListIterator(ObjectListElement<T>* element) : IteratorBase<T, ObjectListIterator<T> >(element) {} 93 83 94 84 /** … … 96 86 @param other The other ObjectListIterator 97 87 */ 98 inline ObjectListIterator(const ObjectListIterator<T>& other) 99 { 100 this->element_ = other.element_; 101 ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this); 102 } 103 104 /** 105 @brief Unregisters the ObjectListIterator from the ObjectList. 106 */ 107 inline ~ObjectListIterator() 108 { 109 ClassIdentifier<T>::getIdentifier()->getObjects()->unregisterObjectListIterator(this); 110 } 111 112 /** 113 @brief Assigns an ObjectListElement. 114 @param element The ObjectListElement 115 */ 116 inline ObjectListIterator<T>& operator=(ObjectListElement<T>* element) 117 { 118 this->element_ = element; 119 return (*this); 120 } 121 122 /** 123 @brief Assigns the element of another ObjectListIterator. 124 @param other The other ObjectListIterator 125 */ 126 inline ObjectListIterator<T>& operator=(const ObjectListIterator<T>& other) 127 { 128 this->element_ = other.element_; 129 return (*this); 130 } 131 132 /** 133 @brief Overloading of the ++it operator: ObjectListIterator points to the next object in the list. 134 @return The ObjectListIterator itself 135 */ 136 inline const ObjectListIterator<T>& operator++() 137 { 138 this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_); 139 return *this; 140 } 141 142 /** 143 @brief Overloading of the it++ operator: ObjectListIterator points to the next object in the list. 144 @return The ObjectListIterator itself 145 */ 146 inline ObjectListIterator<T> operator++(int) 147 { 148 ObjectListIterator<T> copy = *this; 149 this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_); 150 return copy; 151 } 152 153 /** 154 @brief Overloading of the --it operator: ObjectListIterator points to the previous object in the list. 155 @return The ObjectListIterator itself 156 */ 157 inline const ObjectListIterator<T>& operator--() 158 { 159 this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_); 160 return *this; 161 } 162 163 /** 164 @brief Overloading of the it-- operator: ObjectListIterator points to the previous object in the list. 165 @return The ObjectListIterator itself 166 */ 167 inline ObjectListIterator<T> operator--(int i) 168 { 169 ObjectListIterator<T> copy = *this; 170 this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_); 171 return copy; 172 } 88 inline ObjectListIterator(const IteratorBase<T, ObjectListIterator<T> >& other) : IteratorBase<T, ObjectListIterator<T> >(other) {} 173 89 174 90 /** … … 178 94 inline T* operator*() const 179 95 { 180 return this->element_->object_;96 return static_cast<ObjectListElement<T>*>(this->element_)->object_; 181 97 } 182 98 … … 187 103 inline T* operator->() const 188 104 { 189 return this->element_->object_;105 return static_cast<ObjectListElement<T>*>(this->element_)->object_; 190 106 } 191 192 /**193 @brief Overloading of the typecast-operator to bool: returns true if the ObjectListIterator points to an existing object.194 @return True if the ObjectListIterator points to an existing object.195 */196 inline operator bool() const197 {198 return (this->element_ != 0);199 }200 201 /**202 @brief Overloading of the == operator to compare with another ObjectListIterator.203 @param compare The other ObjectListIterator204 @return True if the ObjectListIterator point to the same element205 */206 inline bool operator==(const ObjectListIterator<T>& compare) const207 {208 return (this->element_ == compare.element_);209 }210 211 /**212 @brief Overloading of the != operator to compare with another ObjectListIterator.213 @param compare The other ObjectListIterator214 @return True if the ObjectListIterator point to different elements215 */216 inline bool operator!=(const ObjectListIterator<T>& compare) const217 {218 return (this->element_ != compare.element_);219 }220 221 /**222 @brief Increments the ObjectListIterator if it points at the given object.223 @param object The object to compare with224 */225 inline void incrementIfEqual(Listable* object)226 {227 if (this->element_ && this->element_->objectBase_ == object)228 this->operator++();229 }230 231 private:232 ObjectListElement<T>* element_; //!< The element the iterator points at233 107 }; 234 108 } -
code/trunk/src/libraries/network/Client.cc
r9550 r9667 51 51 #include "FunctionCallManager.h" 52 52 #include "core/CoreIncludes.h" 53 #include "core/CommandLineParser.h"54 53 #include "core/Game.h" 54 #include "core/config/CommandLineParser.h" 55 55 56 56 namespace orxonox -
code/trunk/src/libraries/network/ClientConnectionListener.cc
r8327 r9667 35 35 namespace orxonox 36 36 { 37 RegisterAbstractClass(ClientConnectionListener).inheritsFrom(Class(Listable)); 38 37 39 ClientConnectionListener::ClientConnectionListener() 38 40 { 39 Register RootObject(ClientConnectionListener);41 RegisterObject(ClientConnectionListener); 40 42 } 41 43 -
code/trunk/src/libraries/network/ClientConnectionListener.h
r8327 r9667 31 31 32 32 #include "NetworkPrereqs.h" 33 #include "core/ OrxonoxClass.h"33 #include "core/object/Listable.h" 34 34 35 35 namespace orxonox 36 36 { 37 class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass37 class _NetworkExport ClientConnectionListener : virtual public Listable 38 38 { 39 39 public: -
code/trunk/src/libraries/network/Host.cc
r8858 r9667 33 33 34 34 #include "core/CoreIncludes.h" 35 #include "core/ ObjectList.h"35 #include "core/object/ObjectList.h" 36 36 #include "core/command/ConsoleCommand.h" 37 37 #include "NetworkChatListener.h" … … 145 145 NetworkChatListener::NetworkChatListener() 146 146 { 147 Register RootObject(NetworkChatListener);147 RegisterObject(NetworkChatListener); 148 148 } 149 149 -
code/trunk/src/libraries/network/NetworkChatListener.h
r8858 r9667 32 32 #include "NetworkPrereqs.h" 33 33 34 #include "core/ OrxonoxClass.h"34 #include "core/object/Listable.h" 35 35 36 36 namespace orxonox … … 43 43 in Host and ChatManager. ChatManager is the main derivative of this interface. 44 44 */ 45 class _NetworkExport NetworkChatListener : virtual public OrxonoxClass45 class _NetworkExport NetworkChatListener : virtual public Listable 46 46 { 47 47 friend class Host; -
code/trunk/src/libraries/network/NetworkFunction.cc
r7284 r9667 37 37 std::map<uint32_t, NetworkMemberFunctionBase*> NetworkMemberFunctionBase::idMap_; 38 38 39 // no suitable factory for NetworkFunctionBase (and children), so we declare it abstract 40 RegisterAbstractClass(NetworkFunctionBase).inheritsFrom(Class(Listable)); 41 RegisterAbstractClass(NetworkFunctionStatic).inheritsFrom(Class(NetworkFunctionBase)); 42 RegisterAbstractClass(NetworkMemberFunctionBase).inheritsFrom(Class(NetworkFunctionBase)); 43 39 44 NetworkFunctionBase::NetworkFunctionBase(const std::string& name) 40 45 { 41 RegisterRootObject(NetworkFunctionBase);46 RegisterObject(NetworkFunctionBase); 42 47 43 48 static uint32_t networkID = 0; … … 57 62 std::map<std::string, NetworkFunctionBase*>::iterator it; 58 63 for( it=map.begin(); it!=map.end(); ++it ) 59 it->second->destroy();64 delete it->second; 60 65 } 61 66 -
code/trunk/src/libraries/network/NetworkFunction.h
r8418 r9667 39 39 #include <boost/static_assert.hpp> 40 40 41 #include "core/Identifier.h" 41 #include "core/object/Listable.h" 42 #include "core/class/Identifier.h" 42 43 #include "core/command/Functor.h" 43 44 #include "FunctionCallManager.h" … … 70 71 71 72 72 class _NetworkExport NetworkFunctionBase: virtual public OrxonoxClass{73 class _NetworkExport NetworkFunctionBase: virtual public Listable { 73 74 public: 74 75 NetworkFunctionBase(const std::string& name); -
code/trunk/src/libraries/network/Server.cc
r8858 r9667 48 48 #include "util/Clock.h" 49 49 #include "util/Output.h" 50 #include "core/ObjectList.h"51 50 #include "core/command/Executor.h" 52 51 #include "packet/Chat.h" -
code/trunk/src/libraries/network/TrafficControl.cc
r8858 r9667 33 33 34 34 #include "core/CoreIncludes.h" 35 #include "core/ ConfigValueIncludes.h"35 #include "core/config/ConfigValueIncludes.h" 36 36 #include "synchronisable/Synchronisable.h" 37 37 -
code/trunk/src/libraries/network/WANDiscoverable.cc
r8858 r9667 33 33 34 34 #include "MasterServerProtocol.h" 35 #include "core/ ConfigValueIncludes.h"35 #include "core/config/ConfigValueIncludes.h" 36 36 #include "core/CoreIncludes.h" 37 37 -
code/trunk/src/libraries/network/WANDiscoverable.h
r8858 r9667 30 30 31 31 #include "NetworkPrereqs.h" 32 #include "core/OrxonoxClass.h" 33 #include "core/CoreIncludes.h" 32 #include "core/config/Configurable.h" 34 33 #include "MasterServerComm.h" 35 34 … … 37 36 { 38 37 39 class _NetworkExport WANDiscoverable: public OrxonoxClass38 class _NetworkExport WANDiscoverable: public Configurable 40 39 { 41 40 public: -
code/trunk/src/libraries/network/WANDiscovery.h
r8858 r9667 31 31 #include "NetworkPrereqs.h" 32 32 #include "packet/ServerInformation.h" 33 #include "core/ConfigFileManager.h" 34 #include "core/OrxonoxClass.h" 35 #include "core/ConfigValueIncludes.h" 36 #include "core/CoreIncludes.h" 33 #include "core/config/Configurable.h" 34 #include "core/config/ConfigValueIncludes.h" 37 35 #include "MasterServerComm.h" 38 36 #include "MasterServerProtocol.h" … … 48 46 class _NetworkExport WANDiscovery 49 47 // tolua_end 50 : public OrxonoxClass48 : public Configurable 51 49 { // tolua_export 52 50 public: -
code/trunk/src/libraries/network/packet/ClassID.cc
r8858 r9667 55 55 56 56 //calculate total needed size (for all strings and integers) 57 std::map<std::string, Identifier*>::const_iterator it = Identifier ::getStringIdentifierMapBegin();58 for(;it != Identifier ::getStringIdentifierMapEnd();++it){57 std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getInstance().getIdentifierByStringMap().begin(); 58 for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){ 59 59 id = it->second; 60 60 if(id == NULL || !id->hasFactory()) … … 129 129 130 130 //clear the map of network ids 131 Identifier ::clearNetworkIDs();131 IdentifierManager::getInstance().clearNetworkIDs(); 132 132 133 133 orxout(verbose, context::packets) << "=== processing classids: " << endl; -
code/trunk/src/libraries/network/packet/FunctionIDs.cc
r8858 r9667 35 35 36 36 #include "util/Output.h" 37 #include "core/ ObjectList.h"37 #include "core/object/ObjectList.h" 38 38 #include "network/NetworkFunction.h" 39 39 -
code/trunk/src/libraries/network/packet/Gamestate.cc
r8952 r9667 33 33 #include "util/Output.h" 34 34 #include "util/OrxAssert.h" 35 #include "core/CoreIncludes.h" 35 36 #include "core/GameMode.h" 36 #include "core/ ObjectList.h"37 #include "core/object/ObjectList.h" 37 38 #include "network/synchronisable/Synchronisable.h" 38 39 #include "network/GamestateHandler.h" … … 132 133 tempsize = it->getData(mem, this->sizes_, id, mode); 133 134 if ( tempsize != 0 ) 134 dataVector_.push_back( obj(it->getObjectID(), it->getC reatorID(), tempsize, mem-data_) );135 dataVector_.push_back( obj(it->getObjectID(), it->getContextID(), tempsize, mem-data_) ); 135 136 136 137 #ifndef NDEBUG … … 468 469 { 469 470 assert( objectHeader.getClassID() == htemp.getClassID() ); 470 assert( objectHeader.getC reatorID() == htemp.getCreatorID() );471 assert( objectHeader.getContextID() == htemp.getContextID() ); 471 472 return true; 472 473 } -
code/trunk/src/libraries/network/synchronisable/Serialise.h
r8706 r9667 41 41 #include "util/Serialise.h" 42 42 #include "core/CorePrereqs.h" 43 #include "core/CoreIncludes.h"44 #include "core/BaseObject.h" // remove this if circular dependencies in BaseObject/SmartPtr are fixed45 //#include "core/SmartPtr.h"46 43 47 44 namespace orxonox{ -
code/trunk/src/libraries/network/synchronisable/Synchronisable.cc
r8858 r9667 45 45 uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client 46 46 47 RegisterAbstractClass(Synchronisable).inheritsFrom(Class(OrxonoxInterface)); 48 47 49 /** 48 50 * Constructor: 49 51 * Initializes all Variables and sets the right objectID_ 50 52 */ 51 Synchronisable::Synchronisable( BaseObject* creator)52 { 53 RegisterRootObject(Synchronisable);53 Synchronisable::Synchronisable(Context* context) 54 { 55 RegisterObject(Synchronisable); 54 56 static uint32_t idCounter=0; 55 57 objectMode_=0x1; // by default do not send data to server … … 69 71 this->setPriority( Priority::Normal ); 70 72 71 // get creator id 72 if( creator ) 73 this->creatorID_ = creator->getSceneID(); 74 else 75 this->creatorID_ = OBJECTID_UNKNOWN; 73 // get context id 74 this->contextID_ = this->findContextID(context); 76 75 } 77 76 … … 83 82 { 84 83 // delete callback function objects 85 if(!Identifier ::isCreatingHierarchy()){84 if(!IdentifierManager::getInstance().isCreatingHierarchy()){ 86 85 // remove object from the static objectMap 87 86 if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer())) … … 100 99 } 101 100 101 /** 102 * @brief Returns the id of the context. 103 * If the context is not Synchronisable, it moves on to its parent, recursively. 104 */ 105 uint32_t Synchronisable::findContextID(Context* context) 106 { 107 if (context == NULL) 108 return OBJECTID_UNKNOWN; 109 110 Synchronisable* synchronisableContext = orxonox_cast<Synchronisable*>(context); 111 if (synchronisableContext != NULL) 112 return synchronisableContext->getObjectID(); 113 else 114 return this->findContextID(context->getParentContext()); 115 } 102 116 103 117 /** … … 142 156 } 143 157 assert(id); 144 BaseObject* creator= 0;145 if (header.getC reatorID() != OBJECTID_UNKNOWN)146 { 147 Synchronisable* synchronisable_c reator = Synchronisable::getSynchronisable(header.getCreatorID());148 if (!synchronisable_c reator)158 Context* context = 0; 159 if (header.getContextID() != OBJECTID_UNKNOWN) 160 { 161 Synchronisable* synchronisable_context = Synchronisable::getSynchronisable(header.getContextID()); 162 if (!synchronisable_context) 149 163 { 150 164 mem += header.getDataSize()+SynchronisableHeader::getSize(); //.TODO: this suckz.... remove size from header … … 153 167 } 154 168 else 155 creator = orxonox_cast<BaseObject*>(synchronisable_creator); 156 } 169 context = orxonox_cast<Context*>(synchronisable_context); 170 } 171 else 172 context = Context::getRootContext(); 173 157 174 assert(getSynchronisable(header.getObjectID())==0); //make sure no object with this id exists 158 BaseObject *bo = id->fabricate(creator);175 BaseObject *bo = orxonox_cast<BaseObject*>(id->fabricate(context)); 159 176 assert(bo); 160 177 Synchronisable *no = orxonox_cast<Synchronisable*>(bo); … … 162 179 assert( Synchronisable::objectMap_.find(header.getObjectID()) == Synchronisable::objectMap_.end() ); 163 180 no->setObjectID(header.getObjectID()); 164 //no->c reatorID=header.getCreatorID(); //TODO: remove this181 //no->contextID=header.getContextID(); //TODO: remove this 165 182 no->setClassID(header.getClassID()); 166 assert(no->creatorID_ == header.getCreatorID()); 167 if( creator ) 168 bo->setLevel(creator->getLevel()); // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself) 183 assert(no->contextID_ == header.getContextID()); 184 if( context ) 185 { 186 BaseObject* boContext = orxonox_cast<BaseObject*>(context); 187 if (boContext) 188 bo->setLevel(boContext->getLevel()); // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself) 189 } 169 190 //assert(no->classID_ == header.getClassID()); 170 191 orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl; … … 274 295 275 296 header.setObjectID( this->objectID_ ); 276 header.setC reatorID( this->creatorID_ );297 header.setContextID( this->contextID_ ); 277 298 header.setClassID( this->classID_ ); 278 299 header.setDataSize( tempsize ); … … 331 352 SynchronisableHeader syncHeader2(mem); 332 353 assert( this->getClassID() == syncHeader2.getClassID() ); 333 assert( this->getC reatorID() == syncHeader2.getCreatorID() );354 assert( this->getContextID() == syncHeader2.getContextID() ); 334 355 mem += SynchronisableHeader::getSize(); 335 356 std::vector<SynchronisableVariableBase *>::iterator i; -
code/trunk/src/libraries/network/synchronisable/Synchronisable.h
r8858 r9667 40 40 41 41 #include "util/mbool.h" 42 #include "core/OrxonoxClass.h" 42 #include "util/Output.h" 43 #include "core/class/OrxonoxInterface.h" 43 44 #include "SynchronisableVariable.h" 44 45 #include "NetworkCallback.h" … … 106 107 * @brief: stores information about a Synchronisable 107 108 * 108 * This class stores the information about a Synchronisable (objectID_, classID_, c reatorID_, dataSize)109 * This class stores the information about a Synchronisable (objectID_, classID_, contextID_, dataSize) 109 110 * in an emulated bitset. 110 111 * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream … … 112 113 * Byte 5 to 8: objectID_ 113 114 * Byte 9 to 12: classID_ 114 * Byte 13 to 16: c reatorID_115 * Byte 13 to 16: contextID_ 115 116 */ 116 117 class _NetworkExport SynchronisableHeader: public SynchronisableHeaderLight … … 125 126 inline void setClassID(uint32_t classID_) 126 127 { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()) = classID_; } 127 inline uint32_t getC reatorID() const128 inline uint32_t getContextID() const 128 129 { return *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4); } 129 inline void setC reatorID(uint32_t creatorID_)130 { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = c reatorID_; }130 inline void setContextID(uint32_t contextID_) 131 { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = contextID_; } 131 132 inline void operator=(SynchronisableHeader& h) 132 133 { memcpy(data_, h.data_, getSize()); } … … 143 144 * @author Oliver Scheuss 144 145 */ 145 class _NetworkExport Synchronisable : virtual public Orxonox Class{146 class _NetworkExport Synchronisable : virtual public OrxonoxInterface { 146 147 public: 147 148 friend class packet::Gamestate; … … 157 158 158 159 inline uint32_t getObjectID() const {return this->objectID_;} 159 inline unsigned int getC reatorID() const {return this->creatorID_;}160 inline unsigned int getContextID() const {return this->contextID_;} 160 161 inline uint32_t getClassID() const {return this->classID_;} 161 162 inline unsigned int getPriority() const { return this->objectFrequency_;} … … 169 170 170 171 protected: 171 Synchronisable( BaseObject* creator);172 Synchronisable(Context* context); 172 173 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false); 173 174 template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false); … … 175 176 176 177 void setPriority(unsigned int freq){ objectFrequency_ = freq; } 177 178 uint32_t findContextID(Context* context); 178 179 179 180 private: … … 188 189 189 190 uint32_t objectID_; 190 uint32_t c reatorID_;191 uint32_t contextID_; 191 192 uint32_t classID_; 192 193 -
code/trunk/src/libraries/tools/ParticleInterface.cc
r8858 r9667 43 43 #include "util/Math.h" 44 44 #include "core/CoreIncludes.h" 45 #include "core/ ConfigValueIncludes.h"45 #include "core/config/ConfigValueIncludes.h" 46 46 #include "core/GameMode.h" 47 47 -
code/trunk/src/libraries/tools/ResourceCollection.cc
r8858 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(ResourceCollection);39 RegisterClass(ResourceCollection); 40 40 41 ResourceCollection::ResourceCollection( BaseObject* creator)42 : BaseObject(c reator)41 ResourceCollection::ResourceCollection(Context* context) 42 : BaseObject(context) 43 43 { 44 44 RegisterObject(ResourceCollection); -
code/trunk/src/libraries/tools/ResourceCollection.h
r7401 r9667 41 41 { 42 42 public: 43 ResourceCollection( BaseObject* creator);43 ResourceCollection(Context* context); 44 44 virtual ~ResourceCollection(); 45 45 -
code/trunk/src/libraries/tools/ResourceLocation.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(ResourceLocation);43 RegisterClass(ResourceLocation); 44 44 45 ResourceLocation::ResourceLocation( BaseObject* creator)46 : BaseObject(c reator)45 ResourceLocation::ResourceLocation(Context* context) 46 : BaseObject(context) 47 47 { 48 48 RegisterObject(ResourceLocation); -
code/trunk/src/libraries/tools/ResourceLocation.h
r7401 r9667 43 43 44 44 public: 45 ResourceLocation( BaseObject* creator);45 ResourceLocation(Context* context); 46 46 virtual ~ResourceLocation(); 47 47 -
code/trunk/src/libraries/tools/Shader.cc
r9550 r9667 39 39 namespace orxonox 40 40 { 41 RegisterClassNoArgs(Shader); 42 41 43 /** 42 44 @brief Initializes the values and sets the scene manager. -
code/trunk/src/libraries/tools/Timer.cc
r8729 r9667 132 132 } 133 133 134 RegisterClassNoArgs(Timer); 135 134 136 /** 135 137 @brief Constructor: Sets the default-values. … … 138 140 { 139 141 this->init(); 140 Register RootObject(Timer);142 RegisterObject(Timer); 141 143 } 142 144 … … 151 153 { 152 154 this->init(); 153 Register RootObject(Timer);155 RegisterObject(Timer); 154 156 155 157 this->setTimer(interval, bLoop, executor, bKillAfterCall); -
code/trunk/src/libraries/tools/Timer.h
r8858 r9667 79 79 #include "tools/ToolsPrereqs.h" 80 80 81 #include "core/ OrxonoxClass.h"81 #include "core/class/OrxonoxClass.h" 82 82 #include "core/command/ExecutorPtr.h" 83 83 … … 102 102 on the game time. 103 103 */ 104 class _ToolsExport Timer : virtualpublic OrxonoxClass104 class _ToolsExport Timer : public OrxonoxClass 105 105 { 106 106 public: -
code/trunk/src/libraries/tools/interfaces/Tickable.h
r5781 r9667 44 44 #include "tools/ToolsPrereqs.h" 45 45 46 #include "core/ OrxonoxClass.h"47 #include "core/ Super.h"46 #include "core/class/OrxonoxInterface.h" 47 #include "core/class/Super.h" 48 48 49 49 namespace orxonox 50 50 { 51 51 //! The Tickable interface provides a tick(dt) function, that gets called every frame. 52 class _ToolsExport Tickable : virtual public Orxonox Class52 class _ToolsExport Tickable : virtual public OrxonoxInterface 53 53 { 54 54 public: -
code/trunk/src/libraries/tools/interfaces/TimeFactorListener.h
r7172 r9667 31 31 32 32 #include "tools/ToolsPrereqs.h" 33 #include "core/ OrxonoxClass.h"33 #include "core/object/Listable.h" 34 34 35 35 namespace orxonox 36 36 { 37 class _ToolsExport TimeFactorListener : virtual public OrxonoxClass37 class _ToolsExport TimeFactorListener : virtual public Listable 38 38 { 39 39 public: -
code/trunk/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
r7172 r9667 46 46 float TimeFactorListener::timefactor_s = 1.0f; 47 47 48 RegisterAbstractClass(TimeFactorListener).inheritsFrom(Class(Listable)); 49 48 50 TimeFactorListener::TimeFactorListener() 49 51 { 50 Register RootObject(TimeFactorListener);52 RegisterObject(TimeFactorListener); 51 53 } 52 54 … … 65 67 // Tickable 66 68 //---------------------------- 69 RegisterAbstractClass(Tickable).inheritsFrom(Class(OrxonoxInterface)); 70 67 71 /** 68 72 @brief Constructor: Registers the object in the Tickable-list … … 70 74 Tickable::Tickable() 71 75 { 72 Register RootObject(Tickable);76 RegisterObject(Tickable); 73 77 } 74 78 } -
code/trunk/src/libraries/util/ScopedSingletonManager.h
r8858 r9667 68 68 namespace orxonox 69 69 { 70 class OrxonoxClass;70 class Destroyable; 71 71 72 72 /** … … 166 166 } 167 167 168 //! Destroys the singleton instance - overloaded for OrxonoxClass, calls OrxonoxClass::destroy()169 void destroy( OrxonoxClass*)168 //! Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy() 169 void destroy(Destroyable*) 170 170 { 171 171 singletonPtr_->destroy(); … … 246 246 } 247 247 248 //! Destroys the singleton instance - overloaded for OrxonoxClass, calls OrxonoxClass::destroy()249 void destroy( OrxonoxClass*)248 //! Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy() 249 void destroy(Destroyable*) 250 250 { 251 251 singletonPtr_->destroy(); -
code/trunk/src/modules/designtools/CreateStars.cc
r8351 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(CreateStars);39 RegisterClass(CreateStars); 40 40 41 CreateStars::CreateStars( BaseObject* creator) : BaseObject(creator)41 CreateStars::CreateStars(Context* context) : BaseObject(context) 42 42 { 43 43 RegisterObject(CreateStars); … … 69 69 for(int i=0; i < numStars_; i++) 70 70 { 71 Billboard* bb = new Billboard(this );71 Billboard* bb = new Billboard(this->getContext()); 72 72 73 73 float r = rnd(-colourDiff_,colourDiff_); -
code/trunk/src/modules/designtools/CreateStars.h
r7163 r9667 38 38 { 39 39 public: 40 CreateStars( orxonox::BaseObject* creator);40 CreateStars(Context* context); 41 41 virtual ~CreateStars(); 42 42 -
code/trunk/src/modules/designtools/ScreenshotManager.cc
r8858 r9667 42 42 #include <OgreViewport.h> 43 43 44 #include "core/ConfigValueIncludes.h" 44 #include "core/CoreIncludes.h" 45 #include "core/config/ConfigValueIncludes.h" 45 46 #include "core/GraphicsManager.h" 46 47 #include "core/PathConfig.h" … … 68 69 ScreenshotManager::ScreenshotManager() : finalPicturePB_(NULL), data_(NULL) 69 70 { 70 Register RootObject(ScreenshotManager);71 RegisterObject(ScreenshotManager); 71 72 72 73 this->setConfigValues(); -
code/trunk/src/modules/designtools/ScreenshotManager.h
r8413 r9667 44 44 45 45 #include "util/Singleton.h" 46 #include "core/ OrxonoxClass.h"46 #include "core/config/Configurable.h" 47 47 48 48 namespace orxonox … … 61 61 @ingroup Designtools 62 62 */ 63 class ScreenshotManager : public OrxonoxClass, public Singleton<ScreenshotManager>63 class ScreenshotManager : public Configurable, public Singleton<ScreenshotManager> 64 64 { 65 65 friend class Singleton<ScreenshotManager>; -
code/trunk/src/modules/designtools/SkyboxGenerator.cc
r8858 r9667 40 40 #include "util/ScopedSingletonManager.h" 41 41 #include "core/CoreIncludes.h" 42 #include "core/ ConfigValueIncludes.h"42 #include "core/config/ConfigValueIncludes.h" 43 43 #include "core/GraphicsManager.h" 44 44 #include "core/PathConfig.h" … … 68 68 SkyboxGenerator::SkyboxGenerator() 69 69 { 70 Register RootObject(SkyboxGenerator);70 RegisterObject(SkyboxGenerator); 71 71 72 72 this->setConfigValues(); -
code/trunk/src/modules/designtools/SkyboxGenerator.h
r8232 r9667 36 36 #define __SkyboxGenerator_h__ 37 37 38 #include "core/ OrxonoxClass.h"38 #include "core/config/Configurable.h" 39 39 #include "util/Singleton.h" 40 40 #include "tools/interfaces/Tickable.h" … … 58 58 @ingroup Designtools 59 59 */ 60 class SkyboxGenerator : public virtual OrxonoxClass, public Singleton<SkyboxGenerator>, public Tickable60 class SkyboxGenerator : public virtual Configurable, public Singleton<SkyboxGenerator>, public Tickable 61 61 { 62 62 friend class Singleton<SkyboxGenerator>; -
code/trunk/src/modules/docking/Dock.cc
r8858 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(Dock);48 RegisterClass(Dock); 49 49 50 50 SetConsoleCommand("Dock", "dock", &Dock::cmdDock).addShortcut().setAsInputCommand(); … … 53 53 registerStaticNetworkFunction(Dock::showDockingDialog); 54 54 55 Dock::Dock( BaseObject* creator) : StaticEntity(creator)55 Dock::Dock(Context* context) : StaticEntity(context) 56 56 { 57 57 RegisterObject(Dock); -
code/trunk/src/modules/docking/Dock.h
r8706 r9667 40 40 #include <set> 41 41 42 #include "core/CoreIncludes.h"43 42 #include "core/EventIncludes.h" 44 43 #include "core/XMLPort.h" … … 58 57 { // tolua_export 59 58 public: 60 Dock( BaseObject* creator);59 Dock(Context* context); 61 60 virtual ~Dock(); 62 61 -
code/trunk/src/modules/docking/DockToShip.cc
r8858 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(DockToShip);40 RegisterClass(DockToShip); 41 41 42 DockToShip::DockToShip( BaseObject* creator) : DockingEffect(creator)42 DockToShip::DockToShip(Context* context) : DockingEffect(context) 43 43 { 44 44 RegisterObject(DockToShip); -
code/trunk/src/modules/docking/DockToShip.h
r8706 r9667 57 57 { 58 58 public: 59 DockToShip( BaseObject* creator);59 DockToShip(Context* context); 60 60 virtual ~DockToShip(); 61 61 -
code/trunk/src/modules/docking/DockingAnimation.cc
r8706 r9667 35 35 36 36 #include "DockingEffect.h" // For DockingEffect::findTarget 37 #include "core/CoreIncludes.h" 37 38 38 39 namespace orxonox 39 40 { 40 DockingAnimation::DockingAnimation(BaseObject* creator) : BaseObject(creator) 41 RegisterAbstractClass(DockingAnimation).inheritsFrom(Class(BaseObject)); 42 43 DockingAnimation::DockingAnimation(Context* context) : BaseObject(context) 41 44 { 42 45 RegisterObject(DockingAnimation); -
code/trunk/src/modules/docking/DockingAnimation.h
r8706 r9667 36 36 #define _DockingAnimation_H__ 37 37 38 #include "core/CoreIncludes.h"39 38 #include "core/XMLPort.h" 40 39 … … 64 63 { 65 64 public: 66 DockingAnimation( BaseObject* creator);65 DockingAnimation(Context* context); 67 66 virtual ~DockingAnimation(); 68 67 -
code/trunk/src/modules/docking/DockingController.cc
r9348 r9667 34 34 #include "worldentities/ControllableEntity.h" 35 35 #include "Dock.h" 36 #include "core/CoreIncludes.h" 36 37 37 38 namespace orxonox 38 39 { 39 CreateFactory(DockingController);40 RegisterClass(DockingController); 40 41 41 DockingController::DockingController( BaseObject* creator) : ArtificialController(creator)42 DockingController::DockingController(Context* context) : ArtificialController(context) 42 43 { 43 44 RegisterObject(DockingController); -
code/trunk/src/modules/docking/DockingController.h
r8706 r9667 42 42 { 43 43 public: 44 DockingController( BaseObject* creator);44 DockingController(Context* context); 45 45 virtual ~DockingController(); 46 46 -
code/trunk/src/modules/docking/DockingEffect.cc
r8706 r9667 33 33 34 34 #include "DockingEffect.h" 35 #include "core/CoreIncludes.h" 35 36 36 37 namespace orxonox 37 38 { 38 DockingEffect::DockingEffect(BaseObject* creator) : BaseObject(creator) 39 RegisterAbstractClass(DockingEffect).inheritsFrom(Class(BaseObject)); 40 41 DockingEffect::DockingEffect(Context* context) : BaseObject(context) 39 42 { 40 43 RegisterObject(DockingEffect); -
code/trunk/src/modules/docking/DockingEffect.h
r8706 r9667 36 36 #define _DockingEffect_H__ 37 37 38 #include "core/CoreIncludes.h"39 38 #include "core/XMLPort.h" 40 39 … … 62 61 { 63 62 public: 64 DockingEffect( BaseObject* creator);63 DockingEffect(Context* context); 65 64 virtual ~DockingEffect(); 66 65 -
code/trunk/src/modules/docking/DockingPrecompiledHeaders.h
r8706 r9667 45 45 46 46 #include "core/BaseObject.h" 47 #include "core/CoreIncludes.h"48 47 #include "core/XMLPort.h" 49 48 -
code/trunk/src/modules/docking/DockingTarget.cc
r8858 r9667 33 33 34 34 #include "DockingTarget.h" 35 #include "core/CoreIncludes.h" 35 36 #include "core/XMLPort.h" 36 37 … … 38 39 namespace orxonox 39 40 { 40 CreateFactory(DockingTarget);41 RegisterClass(DockingTarget); 41 42 42 DockingTarget::DockingTarget( BaseObject* creator) : StaticEntity(creator)43 DockingTarget::DockingTarget(Context* context) : StaticEntity(context) 43 44 { 44 45 RegisterObject(DockingTarget); -
code/trunk/src/modules/docking/DockingTarget.h
r8706 r9667 55 55 { 56 56 public: 57 DockingTarget( BaseObject* creator);57 DockingTarget(Context* context); 58 58 virtual ~DockingTarget(); 59 59 -
code/trunk/src/modules/docking/MoveToDockingTarget.cc
r8706 r9667 36 36 37 37 #include "core/XMLPort.h" 38 #include "core/CoreIncludes.h" 38 39 39 40 namespace orxonox 40 41 { 41 CreateFactory(MoveToDockingTarget);42 RegisterClass(MoveToDockingTarget); 42 43 43 MoveToDockingTarget::MoveToDockingTarget( BaseObject *creator) : DockingAnimation(creator)44 MoveToDockingTarget::MoveToDockingTarget(Context* context) : DockingAnimation(context) 44 45 { 45 46 RegisterObject(MoveToDockingTarget); … … 54 55 assert(this->parent_); 55 56 56 DockingController *dockingController = new DockingController(this );57 DockingController *dockingController = new DockingController(this->getContext()); 57 58 dockingController->setDock(this->parent_); 58 59 dockingController->setPlayer(player); -
code/trunk/src/modules/docking/MoveToDockingTarget.h
r8706 r9667 56 56 { 57 57 public: 58 MoveToDockingTarget( BaseObject* creator);58 MoveToDockingTarget(Context* context); 59 59 virtual ~MoveToDockingTarget(); 60 60 -
code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
r9348 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(OldRaceCheckPoint);40 RegisterClass(OldRaceCheckPoint); 41 41 42 OldRaceCheckPoint::OldRaceCheckPoint( BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))42 OldRaceCheckPoint::OldRaceCheckPoint(Context* context): DistanceTrigger(context), RadarViewable(this, static_cast<WorldEntity*>(this)) 43 43 { 44 44 RegisterObject(OldRaceCheckPoint); -
code/trunk/src/modules/gametypes/OldRaceCheckPoint.h
r9348 r9667 45 45 { 46 46 public: 47 OldRaceCheckPoint( BaseObject* creator);47 OldRaceCheckPoint(Context* context); 48 48 virtual ~OldRaceCheckPoint(); 49 49 -
code/trunk/src/modules/gametypes/OldSpaceRace.cc
r9348 r9667 36 36 namespace orxonox 37 37 { 38 CreateUnloadableFactory(OldSpaceRace);38 RegisterUnloadableClass(OldSpaceRace); 39 39 40 OldSpaceRace::OldSpaceRace( BaseObject* creator) : Gametype(creator)40 OldSpaceRace::OldSpaceRace(Context* context) : Gametype(context) 41 41 { 42 42 RegisterObject(OldSpaceRace); -
code/trunk/src/modules/gametypes/OldSpaceRace.h
r9348 r9667 52 52 53 53 public: 54 OldSpaceRace( BaseObject* creator);54 OldSpaceRace(Context* context); 55 55 virtual ~OldSpaceRace() {} 56 56 -
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
r9526 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(RaceCheckPoint);44 45 RaceCheckPoint::RaceCheckPoint( BaseObject* creator) : DistanceMultiTrigger(creator),46 RadarViewable( creator, static_cast<WorldEntity*> (this))43 RegisterClass(RaceCheckPoint); 44 45 RaceCheckPoint::RaceCheckPoint(Context* context) : DistanceMultiTrigger(context), 46 RadarViewable(this, static_cast<WorldEntity*> (this)) 47 47 { 48 48 RegisterObject(RaceCheckPoint); … … 157 157 if (players_.size() > 0) 158 158 { 159 for ( int i = 0; i < players_.size(); i++)159 for (size_t i = 0; i < players_.size(); i++) 160 160 { 161 161 if (this->players_[i]->getClientID() == clientID) … … 172 172 if (players_.size() > 0) 173 173 { 174 for ( int i = 0; i < players_.size(); i++)174 for (size_t i = 0; i < players_.size(); i++) 175 175 { 176 176 if (this->players_[i] == player) -
code/trunk/src/modules/gametypes/RaceCheckPoint.h
r9526 r9667 45 45 { 46 46 public: 47 RaceCheckPoint( BaseObject* creator);47 RaceCheckPoint(Context* context); 48 48 virtual ~RaceCheckPoint(); 49 49 … … 70 70 } 71 71 72 const std::set<int>&getNextCheckpoints()72 std::set<int> getNextCheckpoints() 73 73 { 74 74 return nextCheckpoints_; -
code/trunk/src/modules/gametypes/SpaceRace.cc
r9526 r9667 40 40 namespace orxonox 41 41 { 42 CreateUnloadableFactory(SpaceRace);42 RegisterUnloadableClass(SpaceRace); 43 43 44 SpaceRace::SpaceRace( BaseObject* creator) : Gametype(creator)44 SpaceRace::SpaceRace(Context* context) : Gametype(context) 45 45 { 46 46 RegisterObject(SpaceRace); -
code/trunk/src/modules/gametypes/SpaceRace.h
r9263 r9667 54 54 55 55 public: 56 SpaceRace( BaseObject* creator);56 SpaceRace(Context* context); 57 57 virtual ~SpaceRace() {} 58 58 -
code/trunk/src/modules/gametypes/SpaceRaceBot.cc
r9526 r9667 29 29 namespace orxonox 30 30 { 31 CreateFactory(SpaceRaceBot);31 RegisterClass(SpaceRaceBot); 32 32 33 SpaceRaceBot::SpaceRaceBot( BaseObject* creator) : Bot(creator){33 SpaceRaceBot::SpaceRaceBot(Context* context) : Bot(context){ 34 34 RegisterObject(SpaceRaceBot); 35 35 this->defaultController_ = Class(SpaceRaceController);// ClassByString("") -
code/trunk/src/modules/gametypes/SpaceRaceBot.h
r9526 r9667 41 41 { 42 42 public: 43 SpaceRaceBot( BaseObject* creator);43 SpaceRaceBot(Context* context); 44 44 virtual ~SpaceRaceBot() {} 45 45 }; -
code/trunk/src/modules/gametypes/SpaceRaceController.cc
r9526 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(SpaceRaceController);47 RegisterClass(SpaceRaceController); 48 48 49 49 const int ADJUSTDISTANCE = 500; … … 52 52 * Idea: Find static Point (checkpoints the spaceship has to reach) 53 53 */ 54 SpaceRaceController::SpaceRaceController( BaseObject* creator) :55 ArtificialController(c reator)54 SpaceRaceController::SpaceRaceController(Context* context) : 55 ArtificialController(context) 56 56 { 57 57 RegisterObject(SpaceRaceController) … … 86 86 87 87 }//ausgabe*/ 88 88 /* 89 89 for (std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it != checkpoints.end(); ++it) 90 90 { … … 100 100 } 101 101 } 102 }/* 102 } 103 */ 104 /* 103 105 for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++) 104 106 { … … 301 303 { 302 304 for (size_t i = 0; i < this->checkpoints_.size(); ++i) 303 if (this->checkpoints_[i]->getCheckpointIndex() == index)304 return this->checkpoints_[i];305 if (this->checkpoints_[i]->getCheckpointIndex() == index) 306 return this->checkpoints_[i]; 305 307 return NULL; 306 308 } … … 340 342 //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl; 341 343 //OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp"); 342 /*orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" : "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; ";344 orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" : "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; "; 343 345 temp=previousCheckpoint->getNextCheckpointsAsVector3(); 344 346 orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<": "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; "; 345 orxout()<<endl; *//*347 orxout()<<endl; 346 348 return newTempRaceCheckPoint; 347 349 }*/ -
code/trunk/src/modules/gametypes/SpaceRaceController.h
r9526 r9667 65 65 66 66 public: 67 SpaceRaceController( BaseObject* creator);67 SpaceRaceController(Context* context); 68 68 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 69 69 virtual ~SpaceRaceController(); -
code/trunk/src/modules/gametypes/SpaceRaceManager.cc
r9526 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(SpaceRaceManager);42 RegisterClass(SpaceRaceManager); 43 43 44 SpaceRaceManager::SpaceRaceManager( BaseObject* creator) :45 BaseObject(c reator)44 SpaceRaceManager::SpaceRaceManager(Context* context) : 45 BaseObject(context) 46 46 { 47 47 RegisterObject(SpaceRaceManager); -
code/trunk/src/modules/gametypes/SpaceRaceManager.h
r9526 r9667 55 55 56 56 public: 57 SpaceRaceManager( BaseObject* creator);57 SpaceRaceManager(Context* context); 58 58 virtual ~SpaceRaceManager() ; 59 59 -
code/trunk/src/modules/notifications/NotificationDispatcher.cc
r8891 r9667 48 48 { 49 49 50 CreateUnloadableFactory(NotificationDispatcher);50 RegisterUnloadableClass(NotificationDispatcher); 51 51 52 52 registerMemberNetworkFunction(NotificationDispatcher, broadcastHelper); … … 57 57 Default constructor. Initializes the object. 58 58 */ 59 NotificationDispatcher::NotificationDispatcher( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)59 NotificationDispatcher::NotificationDispatcher(Context* context) : BaseObject(context), Synchronisable(context) 60 60 { 61 61 RegisterObject(NotificationDispatcher); -
code/trunk/src/modules/notifications/NotificationDispatcher.h
r8891 r9667 76 76 { 77 77 public: 78 NotificationDispatcher( BaseObject* creator); //!< Default constructor. Initializes the object.78 NotificationDispatcher(Context* context); //!< Default constructor. Initializes the object. 79 79 virtual ~NotificationDispatcher(); //!< Destructor. 80 80 -
code/trunk/src/modules/notifications/NotificationManager.cc
r8858 r9667 55 55 NotificationManager::NotificationManager() 56 56 { 57 Register RootObject(NotificationManager);57 RegisterObject(NotificationManager); 58 58 59 59 orxout(internal_info, context::notifications) << "NotificatioManager created." << endl; -
code/trunk/src/modules/notifications/NotificationManager.h
r8706 r9667 42 42 #include <string> 43 43 44 #include "core/OrxonoxClass.h"45 44 #include "util/Singleton.h" 46 45 #include "interfaces/NotificationListener.h" -
code/trunk/src/modules/notifications/NotificationQueue.cc
r9253 r9667 44 44 { 45 45 46 CreateFactory(NotificationQueue);46 RegisterClass(NotificationQueue); 47 47 48 48 /** … … 52 52 The creator of the NotificationQueue. 53 53 */ 54 NotificationQueue::NotificationQueue( BaseObject* creator) : BaseObject(creator), Synchronisable(creator), registered_(false)54 NotificationQueue::NotificationQueue(Context* context) : BaseObject(context), Synchronisable(context), registered_(false) 55 55 { 56 56 RegisterObject(NotificationQueue); -
code/trunk/src/modules/notifications/NotificationQueue.h
r8706 r9667 94 94 95 95 public: 96 NotificationQueue( BaseObject* creator);96 NotificationQueue(Context* context); 97 97 virtual ~NotificationQueue(); 98 98 -
code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc
r8858 r9667 46 46 { 47 47 48 CreateFactory(NotificationQueueCEGUI);48 RegisterClass(NotificationQueueCEGUI); 49 49 50 50 /*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer"); 51 51 52 NotificationQueueCEGUI::NotificationQueueCEGUI( BaseObject* creator) : NotificationQueue(creator)52 NotificationQueueCEGUI::NotificationQueueCEGUI(Context* context) : NotificationQueue(context) 53 53 { 54 54 RegisterObject(NotificationQueueCEGUI); -
code/trunk/src/modules/notifications/NotificationQueueCEGUI.h
r8706 r9667 70 70 71 71 public: 72 NotificationQueueCEGUI( BaseObject* creator);72 NotificationQueueCEGUI(Context* context); 73 73 virtual ~NotificationQueueCEGUI(); 74 74 -
code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc
r9550 r9667 44 44 namespace orxonox { 45 45 46 CreateFactory(CommandNotification);46 RegisterClass(CommandNotification); 47 47 48 48 /** … … 50 50 Default Constructor. Registers the object and initializes variables. 51 51 */ 52 CommandNotification::CommandNotification( BaseObject* creator) : NotificationDispatcher(creator)52 CommandNotification::CommandNotification(Context* context) : NotificationDispatcher(context) 53 53 { 54 54 RegisterObject(CommandNotification); -
code/trunk/src/modules/notifications/dispatchers/CommandNotification.h
r7552 r9667 70 70 71 71 public: 72 CommandNotification( BaseObject* creator); //!< Default Constructor.72 CommandNotification(Context* context); //!< Default Constructor. 73 73 virtual ~CommandNotification(); //!< Destructor. 74 74 -
code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc
r8706 r9667 39 39 namespace orxonox { 40 40 41 CreateFactory(SimpleNotification);41 RegisterClass(SimpleNotification); 42 42 43 43 /** … … 45 45 Default Constructor. Registers the object and initializes variables. 46 46 */ 47 SimpleNotification::SimpleNotification( BaseObject* creator) : NotificationDispatcher(creator)47 SimpleNotification::SimpleNotification(Context* context) : NotificationDispatcher(context) 48 48 { 49 49 RegisterObject(SimpleNotification); -
code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h
r7552 r9667 67 67 { 68 68 public: 69 SimpleNotification( BaseObject* creator); //!< Default Constructor.69 SimpleNotification(Context* context); //!< Default Constructor. 70 70 virtual ~SimpleNotification(); //!< Destructor. 71 71 -
code/trunk/src/modules/objects/Attacher.cc
r6417 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(Attacher);36 RegisterClass(Attacher); 37 37 38 Attacher::Attacher( BaseObject* creator) : StaticEntity(creator)38 Attacher::Attacher(Context* context) : StaticEntity(context) 39 39 { 40 40 RegisterObject(Attacher); -
code/trunk/src/modules/objects/Attacher.h
r7601 r9667 48 48 { 49 49 public: 50 Attacher( BaseObject* creator);50 Attacher(Context* context); 51 51 virtual ~Attacher() {} 52 52 -
code/trunk/src/modules/objects/ForceField.cc
r8858 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(ForceField);42 RegisterClass(ForceField); 43 43 44 44 /*static*/ const std::string ForceField::modeTube_s = "tube"; … … 53 53 Constructor. Registers the object and initializes some values. 54 54 */ 55 ForceField::ForceField( BaseObject* creator) : StaticEntity(creator)55 ForceField::ForceField(Context* context) : StaticEntity(context) 56 56 { 57 57 RegisterObject(ForceField); -
code/trunk/src/modules/objects/ForceField.h
r8397 r9667 86 86 { 87 87 public: 88 ForceField( BaseObject* creator);88 ForceField(Context* context); 89 89 virtual ~ForceField(); 90 90 -
code/trunk/src/modules/objects/Planet.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(Planet);44 RegisterClass(Planet); 45 45 46 46 /** 47 47 * @brief Constructor 48 48 */ 49 Planet::Planet( BaseObject* creator) : MovableEntity(creator)49 Planet::Planet(Context* context) : MovableEntity(context) 50 50 { 51 51 RegisterObject(Planet); -
code/trunk/src/modules/objects/Planet.h
r7601 r9667 48 48 { 49 49 public: 50 Planet( BaseObject* creator);50 Planet(Context* context); 51 51 52 52 virtual ~Planet(); -
code/trunk/src/modules/objects/Script.cc
r8858 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(Script);48 RegisterClass(Script); 49 49 50 50 registerStaticNetworkFunction(Script::executeHelper); … … 61 61 The creator of this object. 62 62 */ 63 Script::Script( BaseObject* creator) : BaseObject(creator)63 Script::Script(Context* context) : BaseObject(context) 64 64 { 65 65 RegisterObject(Script); -
code/trunk/src/modules/objects/Script.h
r7601 r9667 95 95 { 96 96 public: 97 Script( BaseObject* creator);97 Script(Context* context); 98 98 virtual ~Script(); 99 99 -
code/trunk/src/modules/objects/SpaceBoundaries.cc
r8858 r9667 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "core/ ObjectListIterator.h"34 #include "core/object/ObjectListIterator.h" 35 35 #include "core/XMLPort.h" 36 36 … … 42 42 namespace orxonox 43 43 { 44 CreateFactory(SpaceBoundaries);45 46 SpaceBoundaries::SpaceBoundaries( BaseObject* creator) : StaticEntity(creator)44 RegisterClass(SpaceBoundaries); 45 46 SpaceBoundaries::SpaceBoundaries(Context* context) : StaticEntity(context) 47 47 { 48 48 RegisterObject(SpaceBoundaries); … … 73 73 { 74 74 pawnsIn_.clear(); 75 for(ObjectList Iterator<Pawn>current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)75 for(ObjectList<Pawn>::iterator current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current) 76 76 { 77 77 Pawn* currentPawn = *current; … … 104 104 if (current == this->billboards_.size()) 105 105 { 106 Billboard* billboard = new Billboard(this );106 Billboard* billboard = new Billboard(this->getContext()); 107 107 billboard->setPosition(position); 108 108 billboard->setSyncMode(ObjectDirection::None); -
code/trunk/src/modules/objects/SpaceBoundaries.h
r8767 r9667 36 36 #include <vector> 37 37 38 #include "core/CoreIncludes.h" 39 #include "core/WeakPtr.h" 38 #include "core/object/WeakPtr.h" 40 39 41 40 #include "tools/interfaces/Tickable.h" … … 76 75 { 77 76 public: 78 SpaceBoundaries( BaseObject* creator);77 SpaceBoundaries(Context* context); 79 78 ~SpaceBoundaries(); 80 79 -
code/trunk/src/modules/objects/Turret.cc
r9526 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(Turret);37 RegisterClass(Turret); 38 38 39 39 /** 40 40 * @brief Constructor 41 41 */ 42 Turret::Turret( BaseObject* creator) : SpaceShip(creator)42 Turret::Turret(Context* context) : SpaceShip(context) 43 43 { 44 44 RegisterObject(Turret); 45 this->controller_ = new WaypointPatrolController(this );45 this->controller_ = new WaypointPatrolController(this->getContext()); 46 46 } 47 47 -
code/trunk/src/modules/objects/Turret.h
r9526 r9667 45 45 { 46 46 public: 47 Turret( BaseObject* creator);47 Turret(Context* context); 48 48 virtual ~Turret(); 49 49 -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(BoxCollisionShape);44 RegisterClass(BoxCollisionShape); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 BoxCollisionShape::BoxCollisionShape( BaseObject* creator) : CollisionShape(creator)50 BoxCollisionShape::BoxCollisionShape(Context* context) : CollisionShape(context) 51 51 { 52 52 RegisterObject(BoxCollisionShape); -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
r8706 r9667 57 57 { 58 58 public: 59 BoxCollisionShape( BaseObject* creator);59 BoxCollisionShape(Context* context); 60 60 virtual ~BoxCollisionShape(); 61 61 -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(ConeCollisionShape);44 RegisterClass(ConeCollisionShape); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 ConeCollisionShape::ConeCollisionShape( BaseObject* creator) : CollisionShape(creator)50 ConeCollisionShape::ConeCollisionShape(Context* context) : CollisionShape(context) 51 51 { 52 52 RegisterObject(ConeCollisionShape); -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
r8706 r9667 55 55 { 56 56 public: 57 ConeCollisionShape( BaseObject* creator);57 ConeCollisionShape(Context* context); 58 58 virtual ~ConeCollisionShape(); 59 59 -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(PlaneCollisionShape);44 RegisterClass(PlaneCollisionShape); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 PlaneCollisionShape::PlaneCollisionShape( BaseObject* creator) : CollisionShape(creator)50 PlaneCollisionShape::PlaneCollisionShape(Context* context) : CollisionShape(context) 51 51 { 52 52 RegisterObject(PlaneCollisionShape); -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
r8706 r9667 57 57 { 58 58 public: 59 PlaneCollisionShape( BaseObject* creator);59 PlaneCollisionShape(Context* context); 60 60 virtual ~PlaneCollisionShape(); 61 61 -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(SphereCollisionShape);44 RegisterClass(SphereCollisionShape); 45 45 46 46 /** … … 48 48 Constructor. registers and initializes the object. 49 49 */ 50 SphereCollisionShape::SphereCollisionShape( BaseObject* creator) : CollisionShape(creator)50 SphereCollisionShape::SphereCollisionShape(Context* context) : CollisionShape(context) 51 51 { 52 52 RegisterObject(SphereCollisionShape); -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
r8706 r9667 55 55 { 56 56 public: 57 SphereCollisionShape( BaseObject* creator);57 SphereCollisionShape(Context* context); 58 58 virtual ~SphereCollisionShape(); 59 59 -
code/trunk/src/modules/objects/eventsystem/EventDispatcher.cc
r5929 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(EventDispatcher);37 RegisterClass(EventDispatcher); 38 38 39 EventDispatcher::EventDispatcher( BaseObject* creator) : BaseObject(creator)39 EventDispatcher::EventDispatcher(Context* context) : BaseObject(context) 40 40 { 41 41 RegisterObject(EventDispatcher); -
code/trunk/src/modules/objects/eventsystem/EventDispatcher.h
r7601 r9667 46 46 { 47 47 public: 48 EventDispatcher( BaseObject* creator);48 EventDispatcher(Context* context); 49 49 virtual ~EventDispatcher(); 50 50 -
code/trunk/src/modules/objects/eventsystem/EventFilter.cc
r8858 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(EventFilter);38 RegisterClass(EventFilter); 39 39 40 EventFilter::EventFilter( BaseObject* creator) : BaseObject(creator)40 EventFilter::EventFilter(Context* context) : BaseObject(context) 41 41 { 42 42 RegisterObject(EventFilter); -
code/trunk/src/modules/objects/eventsystem/EventFilter.h
r7601 r9667 46 46 { 47 47 public: 48 EventFilter( BaseObject* creator);48 EventFilter(Context* context); 49 49 virtual ~EventFilter(); 50 50 -
code/trunk/src/modules/objects/eventsystem/EventListener.cc
r8858 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(EventListener);37 RegisterClass(EventListener); 38 38 39 EventListener::EventListener( BaseObject* creator) : BaseObject(creator)39 EventListener::EventListener(Context* context) : BaseObject(context) 40 40 { 41 41 RegisterObject(EventListener); -
code/trunk/src/modules/objects/eventsystem/EventListener.h
r7601 r9667 47 47 { 48 48 public: 49 EventListener( BaseObject* creator);49 EventListener(Context* context); 50 50 virtual ~EventListener(); 51 51 -
code/trunk/src/modules/objects/eventsystem/EventName.cc
r5929 r9667 32 32 namespace orxonox 33 33 { 34 CreateFactory(EventName);34 RegisterClass(EventName); 35 35 36 EventName::EventName( BaseObject* creator) : BaseObject(creator)36 EventName::EventName(Context* context) : BaseObject(context) 37 37 { 38 38 RegisterObject(EventName); -
code/trunk/src/modules/objects/eventsystem/EventName.h
r7601 r9667 45 45 { 46 46 public: 47 EventName( BaseObject* creator);47 EventName(Context* context); 48 48 virtual ~EventName() {} 49 49 }; -
code/trunk/src/modules/objects/eventsystem/EventTarget.cc
r8858 r9667 33 33 namespace orxonox 34 34 { 35 CreateFactory(EventTarget);35 RegisterClass(EventTarget); 36 36 37 EventTarget::EventTarget( BaseObject* creator) : BaseObject(creator)37 EventTarget::EventTarget(Context* context) : BaseObject(context) 38 38 { 39 39 RegisterObject(EventTarget); -
code/trunk/src/modules/objects/eventsystem/EventTarget.h
r7601 r9667 46 46 { 47 47 public: 48 EventTarget( BaseObject* creator);48 EventTarget(Context* context); 49 49 virtual ~EventTarget(); 50 50 -
code/trunk/src/modules/objects/triggers/CheckPoint.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(CheckPoint);44 RegisterClass(CheckPoint); 45 45 46 CheckPoint::CheckPoint( BaseObject* creator)47 : DistanceTrigger(c reator)48 , RadarViewable( creator, static_cast<WorldEntity*>(this))46 CheckPoint::CheckPoint(Context* context) 47 : DistanceTrigger(context) 48 , RadarViewable(this, static_cast<WorldEntity*>(this)) 49 49 { 50 50 RegisterObject(CheckPoint); -
code/trunk/src/modules/objects/triggers/CheckPoint.h
r7601 r9667 55 55 { 56 56 public: 57 CheckPoint( BaseObject* creator);57 CheckPoint(Context* context); 58 58 virtual ~CheckPoint(); 59 59 -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
r8858 r9667 47 47 /*static*/ const std::string DistanceMultiTrigger::beaconModeExlcude_s = "exclude"; 48 48 49 CreateFactory(DistanceMultiTrigger);49 RegisterClass(DistanceMultiTrigger); 50 50 51 51 /** … … 53 53 Default Constructor. Registers the object and initializes default values. 54 54 */ 55 DistanceMultiTrigger::DistanceMultiTrigger( BaseObject* creator) : MultiTrigger(creator)55 DistanceMultiTrigger::DistanceMultiTrigger(Context* context) : MultiTrigger(context) 56 56 { 57 57 RegisterObject(DistanceMultiTrigger); -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
r9016 r9667 40 40 #include <map> 41 41 42 #include "core/ WeakPtr.h"42 #include "core/object/WeakPtr.h" 43 43 44 44 #include "worldentities/WorldEntity.h" … … 95 95 96 96 public: 97 DistanceMultiTrigger( BaseObject* creator); // Default Constructor. Registers the object and initializes default values.97 DistanceMultiTrigger(Context* context); // Default Constructor. Registers the object and initializes default values. 98 98 virtual ~DistanceMultiTrigger(); // Destructor. 99 99 -
code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
r8858 r9667 49 49 /*static*/ const std::string DistanceTrigger::beaconModeExlcude_s = "exclude"; 50 50 51 CreateFactory(DistanceTrigger);51 RegisterClass(DistanceTrigger); 52 52 53 53 /** … … 57 57 The creator of this trigger. 58 58 */ 59 DistanceTrigger::DistanceTrigger( BaseObject* creator) : Trigger(creator)59 DistanceTrigger::DistanceTrigger(Context* context) : Trigger(context) 60 60 { 61 61 RegisterObject(DistanceTrigger); -
code/trunk/src/modules/objects/triggers/DistanceTrigger.h
r8706 r9667 97 97 { 98 98 public: 99 DistanceTrigger( BaseObject* creator); // Constructor. Registers and initializes the object.99 DistanceTrigger(Context* context); // Constructor. Registers and initializes the object. 100 100 virtual ~DistanceTrigger(); 101 101 -
code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc
r7601 r9667 40 40 { 41 41 42 CreateFactory(DistanceTriggerBeacon);42 RegisterClass(DistanceTriggerBeacon); 43 43 44 44 /** … … 48 48 The creator of this object. 49 49 */ 50 DistanceTriggerBeacon::DistanceTriggerBeacon( BaseObject* creator) : StaticEntity(creator)50 DistanceTriggerBeacon::DistanceTriggerBeacon(Context* context) : StaticEntity(context) 51 51 { 52 52 RegisterObject(DistanceTriggerBeacon); -
code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h
r7601 r9667 57 57 58 58 public: 59 DistanceTriggerBeacon( BaseObject* creator); //!< Constructor.59 DistanceTriggerBeacon(Context* context); //!< Constructor. 60 60 virtual ~DistanceTriggerBeacon() {} //!< Destructor. 61 61 -
code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc
r7601 r9667 43 43 { 44 44 45 CreateFactory(EventMultiTrigger);45 RegisterClass(EventMultiTrigger); 46 46 47 47 /** … … 49 49 Constructor. Registers the object. 50 50 */ 51 EventMultiTrigger::EventMultiTrigger( BaseObject* creator) : MultiTrigger(creator)51 EventMultiTrigger::EventMultiTrigger(Context* context) : MultiTrigger(context) 52 52 { 53 53 RegisterObject(EventMultiTrigger); -
code/trunk/src/modules/objects/triggers/EventMultiTrigger.h
r8213 r9667 73 73 74 74 public: 75 EventMultiTrigger( BaseObject* creator); //!< Constructor. Registers the object.75 EventMultiTrigger(Context* context); //!< Constructor. Registers the object. 76 76 virtual ~EventMultiTrigger(); //!< Destructor. 77 77 -
code/trunk/src/modules/objects/triggers/EventTrigger.cc
r8213 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(EventTrigger);42 RegisterClass(EventTrigger); 43 43 44 44 /** … … 48 48 The creator of the EventTrigger. 49 49 */ 50 EventTrigger::EventTrigger( BaseObject* creator) : Trigger(creator)50 EventTrigger::EventTrigger(Context* context) : Trigger(context) 51 51 { 52 52 RegisterObject(EventTrigger); -
code/trunk/src/modules/objects/triggers/EventTrigger.h
r8706 r9667 70 70 { 71 71 public: 72 EventTrigger( BaseObject* creator); // Constructor. Registers and initializes the object.72 EventTrigger(Context* context); // Constructor. Registers and initializes the object. 73 73 virtual ~EventTrigger(); 74 74 -
code/trunk/src/modules/objects/triggers/MultiTrigger.cc
r8858 r9667 43 43 { 44 44 45 CreateFactory(MultiTrigger);45 RegisterClass(MultiTrigger); 46 46 47 47 /** … … 51 51 The creator. 52 52 */ 53 MultiTrigger::MultiTrigger( BaseObject* creator) : TriggerBase(creator)53 MultiTrigger::MultiTrigger(Context* context) : TriggerBase(context) 54 54 { 55 55 RegisterObject(MultiTrigger); … … 451 451 } 452 452 453 MultiTriggerContainer* container = new MultiTriggerContainer(this , this, originator);453 MultiTriggerContainer* container = new MultiTriggerContainer(this->getContext(), this, originator); 454 454 this->fireEvent(status, container); 455 455 orxout(verbose, context::triggers) << "MultiTrigger '" << this->getName() << "' (&" << this << "): Fired event. originator: " << originator->getIdentifier()->getName() << " (&" << originator << "), status: " << status << "." << endl; -
code/trunk/src/modules/objects/triggers/MultiTrigger.h
r9016 r9667 99 99 { 100 100 public: 101 MultiTrigger( BaseObject* creator); //!< Constructor. Registers the objects and initializes default values.101 MultiTrigger(Context* context); //!< Constructor. Registers the objects and initializes default values. 102 102 virtual ~MultiTrigger(); //!< Destructor. 103 103 -
code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc
r8706 r9667 42 42 { 43 43 44 CreateUnloadableFactory(MultiTriggerContainer);44 RegisterUnloadableClass(MultiTriggerContainer); 45 45 46 46 /** … … 50 50 The creator. 51 51 */ 52 MultiTriggerContainer::MultiTriggerContainer( BaseObject* creator) : BaseObject(creator), originator_(NULL), data_(NULL)52 MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(NULL), data_(NULL) 53 53 { 54 54 RegisterObject(MultiTriggerContainer); … … 65 65 A pointer to the data that should be sent with the container. 66 66 */ 67 MultiTriggerContainer::MultiTriggerContainer( BaseObject* creator, MultiTrigger* originator, BaseObject* data) : BaseObject(creator), originator_(originator), data_(data)67 MultiTriggerContainer::MultiTriggerContainer(Context* context, MultiTrigger* originator, BaseObject* data) : BaseObject(context), originator_(originator), data_(data) 68 68 { 69 69 RegisterObject(MultiTriggerContainer); -
code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h
r7601 r9667 58 58 59 59 public: 60 MultiTriggerContainer( BaseObject* creator); //!< Default constructor. Registers the object and creates an empty container.61 MultiTriggerContainer( BaseObject* creator, MultiTrigger* originator, BaseObject* data); //!< Constructor. Registers the object and sets the input values.60 MultiTriggerContainer(Context* context); //!< Default constructor. Registers the object and creates an empty container. 61 MultiTriggerContainer(Context* context, MultiTrigger* originator, BaseObject* data); //!< Constructor. Registers the object and sets the input values. 62 62 virtual ~MultiTriggerContainer(); //!< Destructor. 63 63 -
code/trunk/src/modules/objects/triggers/Trigger.cc
r8706 r9667 47 47 SetConsoleCommand("Trigger", "debugFlares", &Trigger::debugFlares).defaultValues(false); 48 48 49 CreateFactory(Trigger);49 RegisterClass(Trigger); 50 50 51 51 /** … … 55 55 The creator of the Trigger. 56 56 */ 57 Trigger::Trigger( BaseObject* creator) : TriggerBase(creator)57 Trigger::Trigger(Context* context) : TriggerBase(context) 58 58 { 59 59 RegisterObject(Trigger); -
code/trunk/src/modules/objects/triggers/Trigger.h
r8213 r9667 80 80 { 81 81 public: 82 Trigger( BaseObject* creator); // Constructor. Registers and initializes the object.82 Trigger(Context* context); // Constructor. Registers and initializes the object. 83 83 virtual ~Trigger(); 84 84 -
code/trunk/src/modules/objects/triggers/TriggerBase.cc
r8858 r9667 46 46 /*static*/ const std::string TriggerBase::xor_s = "xor"; 47 47 48 CreateFactory(TriggerBase);48 RegisterClass(TriggerBase); 49 49 50 50 /** … … 52 52 Constructor. Registers the object and initializes some values. 53 53 */ 54 TriggerBase::TriggerBase( BaseObject* creator) : StaticEntity(creator)54 TriggerBase::TriggerBase(Context* context) : StaticEntity(context) 55 55 { 56 56 RegisterObject(TriggerBase); -
code/trunk/src/modules/objects/triggers/TriggerBase.h
r8706 r9667 74 74 { 75 75 public: 76 TriggerBase( BaseObject* creator);76 TriggerBase(Context* context); 77 77 virtual ~TriggerBase(); 78 78 -
code/trunk/src/modules/overlays/FadeoutText.cc
r5929 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(FadeoutText);38 RegisterClass(FadeoutText); 39 39 40 FadeoutText::FadeoutText( BaseObject* creator) : OverlayText(creator)40 FadeoutText::FadeoutText(Context* context) : OverlayText(context) 41 41 { 42 42 RegisterObject(FadeoutText); -
code/trunk/src/modules/overlays/FadeoutText.h
r7401 r9667 41 41 { 42 42 public: 43 FadeoutText( BaseObject* creator);43 FadeoutText(Context* context); 44 44 virtual ~FadeoutText() {} 45 45 -
code/trunk/src/modules/overlays/GUIOverlay.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(GUIOverlay);43 RegisterClass(GUIOverlay); 44 44 45 GUIOverlay::GUIOverlay( BaseObject* creator) : OrxonoxOverlay(creator)45 GUIOverlay::GUIOverlay(Context* context) : OrxonoxOverlay(context) 46 46 { 47 47 RegisterObject(GUIOverlay); -
code/trunk/src/modules/overlays/GUIOverlay.h
r7401 r9667 41 41 public: 42 42 43 GUIOverlay( BaseObject* creator);43 GUIOverlay(Context* context); 44 44 virtual ~GUIOverlay(); 45 45 -
code/trunk/src/modules/overlays/OverlayText.cc
r7401 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(OverlayText);43 RegisterClass(OverlayText); 44 44 45 45 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Left); … … 47 47 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Right); 48 48 49 OverlayText::OverlayText( BaseObject* creator)50 : OrxonoxOverlay(c reator)49 OverlayText::OverlayText(Context* context) 50 : OrxonoxOverlay(context) 51 51 { 52 52 RegisterObject(OverlayText); -
code/trunk/src/modules/overlays/OverlayText.h
r7401 r9667 49 49 }; 50 50 51 OverlayText( BaseObject* creator);51 OverlayText(Context* context); 52 52 virtual ~OverlayText(); 53 53 -
code/trunk/src/modules/overlays/debugging/DebugFPSText.cc
r5781 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(DebugFPSText);37 RegisterClass(DebugFPSText); 38 38 39 DebugFPSText::DebugFPSText( BaseObject* creator) : OverlayText(creator)39 DebugFPSText::DebugFPSText(Context* context) : OverlayText(context) 40 40 { 41 41 RegisterObject(DebugFPSText); -
code/trunk/src/modules/overlays/debugging/DebugFPSText.h
r5781 r9667 40 40 { 41 41 public: 42 DebugFPSText( BaseObject* creator);42 DebugFPSText(Context* context); 43 43 virtual ~DebugFPSText(); 44 44 -
code/trunk/src/modules/overlays/debugging/DebugRTRText.cc
r5781 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(DebugRTRText);37 RegisterClass(DebugRTRText); 38 38 39 DebugRTRText::DebugRTRText( BaseObject* creator) : OverlayText(creator)39 DebugRTRText::DebugRTRText(Context* context) : OverlayText(context) 40 40 { 41 41 RegisterObject(DebugRTRText); -
code/trunk/src/modules/overlays/debugging/DebugRTRText.h
r5781 r9667 40 40 { 41 41 public: 42 DebugRTRText( BaseObject* creator);42 DebugRTRText(Context* context); 43 43 virtual ~DebugRTRText(); 44 44 -
code/trunk/src/modules/overlays/hud/AnnounceMessage.cc
r5781 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(AnnounceMessage);36 RegisterClass(AnnounceMessage); 37 37 38 AnnounceMessage::AnnounceMessage( BaseObject* creator) : FadeoutText(creator)38 AnnounceMessage::AnnounceMessage(Context* context) : FadeoutText(context) 39 39 { 40 40 RegisterObject(AnnounceMessage); -
code/trunk/src/modules/overlays/hud/AnnounceMessage.h
r5781 r9667 40 40 { 41 41 public: 42 AnnounceMessage( BaseObject* creator);42 AnnounceMessage(Context* context); 43 43 virtual ~AnnounceMessage() {} 44 44 -
code/trunk/src/modules/overlays/hud/ChatOverlay.cc
r8858 r9667 35 35 #include "util/DisplayStringConversions.h" 36 36 #include "core/CoreIncludes.h" 37 #include "core/ ConfigValueIncludes.h"37 #include "core/config/ConfigValueIncludes.h" 38 38 #include "core/command/Executor.h" 39 39 … … 44 44 namespace orxonox 45 45 { 46 CreateFactory(ChatOverlay);46 RegisterClass(ChatOverlay); 47 47 48 ChatOverlay::ChatOverlay( BaseObject* creator)49 : OverlayText(c reator)48 ChatOverlay::ChatOverlay(Context* context) 49 : OverlayText(context) 50 50 { 51 51 RegisterObject(ChatOverlay); -
code/trunk/src/modules/overlays/hud/ChatOverlay.h
r8858 r9667 43 43 { 44 44 public: 45 ChatOverlay( BaseObject* creator);45 ChatOverlay(Context* context); 46 46 virtual ~ChatOverlay(); 47 47 -
code/trunk/src/modules/overlays/hud/DeathMessage.cc
r5781 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(DeathMessage);36 RegisterClass(DeathMessage); 37 37 38 DeathMessage::DeathMessage( BaseObject* creator) : FadeoutText(creator)38 DeathMessage::DeathMessage(Context* context) : FadeoutText(context) 39 39 { 40 40 RegisterObject(DeathMessage); -
code/trunk/src/modules/overlays/hud/DeathMessage.h
r5781 r9667 40 40 { 41 41 public: 42 DeathMessage( BaseObject* creator);42 DeathMessage(Context* context); 43 43 virtual ~DeathMessage() {} 44 44 -
code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc
r7163 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(GametypeFadingMessage);36 RegisterClass(GametypeFadingMessage); 37 37 38 GametypeFadingMessage::GametypeFadingMessage( BaseObject* creator) : FadeoutText(creator)38 GametypeFadingMessage::GametypeFadingMessage(Context* context) : FadeoutText(context) 39 39 { 40 40 RegisterObject(GametypeFadingMessage); -
code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h
r8729 r9667 40 40 { 41 41 public: 42 GametypeFadingMessage( BaseObject* creator);42 GametypeFadingMessage(Context* context); 43 43 virtual ~GametypeFadingMessage(); 44 44 -
code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc
r7163 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(GametypeStaticMessage);38 RegisterClass(GametypeStaticMessage); 39 39 40 40 41 GametypeStaticMessage::GametypeStaticMessage( BaseObject* creator) : OverlayText(creator)41 GametypeStaticMessage::GametypeStaticMessage(Context* context) : OverlayText(context) 42 42 { 43 43 RegisterObject(GametypeStaticMessage); -
code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h
r7163 r9667 43 43 { 44 44 public: 45 GametypeStaticMessage( BaseObject* creator);45 GametypeStaticMessage(Context* context); 46 46 virtual ~GametypeStaticMessage(); 47 47 -
code/trunk/src/modules/overlays/hud/HUDBar.cc
r8706 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(BarColour);48 49 BarColour::BarColour( BaseObject* creator)50 : BaseObject(c reator)47 RegisterClass(BarColour); 48 49 BarColour::BarColour(Context* context) 50 : BaseObject(context) 51 51 { 52 52 RegisterObject(BarColour); … … 67 67 unsigned int HUDBar::materialcount_s = 0; 68 68 69 HUDBar::HUDBar(BaseObject* creator) 70 : OrxonoxOverlay(creator), right2Left_(false), autoColour_(false) 69 RegisterClass(HUDBar); 70 71 HUDBar::HUDBar(Context* context) 72 : OrxonoxOverlay(context), right2Left_(false), autoColour_(false) 71 73 { 72 74 RegisterObject(HUDBar); -
code/trunk/src/modules/overlays/hud/HUDBar.h
r8706 r9667 48 48 { 49 49 public: 50 BarColour( BaseObject* creator);50 BarColour(Context* context); 51 51 virtual ~BarColour() { } 52 52 … … 68 68 { 69 69 public: 70 HUDBar( BaseObject* creator);70 HUDBar(Context* context); 71 71 virtual ~HUDBar(); 72 72 -
code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
r9348 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(HUDBoostBar);37 RegisterClass(HUDBoostBar); 38 38 39 HUDBoostBar::HUDBoostBar( BaseObject* creator)40 : HUDBar(c reator)39 HUDBoostBar::HUDBoostBar(Context* context) 40 : HUDBar(context) 41 41 { 42 42 RegisterObject(HUDBoostBar); -
code/trunk/src/modules/overlays/hud/HUDBoostBar.h
r9348 r9667 40 40 { 41 41 public: 42 HUDBoostBar( BaseObject* creator);42 HUDBoostBar(Context* context); 43 43 virtual ~HUDBoostBar(); 44 44 -
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
r9348 r9667 29 29 #include "HUDEnemyHealthBar.h" 30 30 31 #include "core/ ConfigValueIncludes.h"31 #include "core/config/ConfigValueIncludes.h" 32 32 #include "worldentities/pawns/Pawn.h" 33 33 34 34 namespace orxonox 35 35 { 36 CreateFactory(HUDEnemyHealthBar);36 RegisterClass(HUDEnemyHealthBar); 37 37 38 HUDEnemyHealthBar::HUDEnemyHealthBar( BaseObject* creator) : HUDHealthBar(creator)38 HUDEnemyHealthBar::HUDEnemyHealthBar(Context* context) : HUDHealthBar(context) 39 39 { 40 40 RegisterObject(HUDEnemyHealthBar); -
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
r9348 r9667 37 37 { 38 38 public: 39 HUDEnemyHealthBar( BaseObject* creator);39 HUDEnemyHealthBar(Context* context); 40 40 virtual ~HUDEnemyHealthBar(); 41 41 -
code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
r6054 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(HUDHealthBar);39 RegisterClass(HUDHealthBar); 40 40 41 HUDHealthBar::HUDHealthBar( BaseObject* creator) : HUDBar(creator)41 HUDHealthBar::HUDHealthBar(Context* context) : HUDBar(context) 42 42 { 43 43 RegisterObject(HUDHealthBar); … … 46 46 this->bUseBarColour_ = false; 47 47 48 this->textoverlay_ = new OverlayText(this );48 this->textoverlay_ = new OverlayText(this->getContext()); 49 49 50 50 assert(this->textoverlay_.get()); -
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
r9259 r9667 42 42 { 43 43 public: 44 HUDHealthBar( BaseObject* creator);44 HUDHealthBar(Context* context); 45 45 virtual ~HUDHealthBar(); 46 46 -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r9526 r9667 51 51 #include "worldentities/pawns/Pawn.h" 52 52 #include "worldentities/WorldEntity.h" 53 #include "core/ ConfigValueIncludes.h"53 #include "core/config/ConfigValueIncludes.h" 54 54 #include "tools/TextureGenerator.h" 55 55 // #include <boost/bind/bind_template.hpp> … … 67 67 return a.second < b.second; 68 68 } 69 CreateFactory( HUDNavigation );69 RegisterClass ( HUDNavigation ); 70 70 71 71 HUDNavigation* HUDNavigation::localHUD_s = 0; 72 72 73 HUDNavigation::HUDNavigation( BaseObject* creator) :74 OrxonoxOverlay(c reator)73 HUDNavigation::HUDNavigation(Context* context) : 74 OrxonoxOverlay(context) 75 75 { 76 76 RegisterObject(HUDNavigation) -
code/trunk/src/modules/overlays/hud/HUDNavigation.h
r9526 r9667 46 46 { 47 47 public: 48 HUDNavigation( BaseObject* creator);48 HUDNavigation(Context* context); 49 49 virtual ~HUDNavigation(); 50 50 -
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r9348 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(HUDRadar);47 48 HUDRadar::HUDRadar( BaseObject* creator)49 : OrxonoxOverlay(c reator)46 RegisterClass(HUDRadar); 47 48 HUDRadar::HUDRadar(Context* context) 49 : OrxonoxOverlay(context) 50 50 { 51 51 RegisterObject(HUDRadar); -
code/trunk/src/modules/overlays/hud/HUDRadar.h
r8891 r9667 46 46 { 47 47 public: 48 HUDRadar( BaseObject* creator);48 HUDRadar(Context* context); 49 49 virtual ~HUDRadar(); 50 50 -
code/trunk/src/modules/overlays/hud/HUDSpeedBar.cc
r8706 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(HUDSpeedBar);38 RegisterClass(HUDSpeedBar); 39 39 40 HUDSpeedBar::HUDSpeedBar( BaseObject* creator)41 : HUDBar(c reator)40 HUDSpeedBar::HUDSpeedBar(Context* context) 41 : HUDBar(context) 42 42 { 43 43 RegisterObject(HUDSpeedBar); -
code/trunk/src/modules/overlays/hud/HUDSpeedBar.h
r5781 r9667 41 41 { 42 42 public: 43 HUDSpeedBar( BaseObject* creator);43 HUDSpeedBar(Context* context); 44 44 virtual ~HUDSpeedBar(); 45 45 -
code/trunk/src/modules/overlays/hud/HUDTimer.cc
r5781 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(HUDTimer);38 RegisterClass(HUDTimer); 39 39 40 HUDTimer::HUDTimer( BaseObject* creator) : OverlayText(creator)40 HUDTimer::HUDTimer(Context* context) : OverlayText(context) 41 41 { 42 42 RegisterObject(HUDTimer); -
code/trunk/src/modules/overlays/hud/HUDTimer.h
r5781 r9667 40 40 { 41 41 public: 42 HUDTimer( BaseObject* creator);42 HUDTimer(Context* context); 43 43 virtual ~HUDTimer(); 44 44 -
code/trunk/src/modules/overlays/hud/KillMessage.cc
r5781 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(KillMessage);36 RegisterClass(KillMessage); 37 37 38 KillMessage::KillMessage( BaseObject* creator) : FadeoutText(creator)38 KillMessage::KillMessage(Context* context) : FadeoutText(context) 39 39 { 40 40 RegisterObject(KillMessage); -
code/trunk/src/modules/overlays/hud/KillMessage.h
r5781 r9667 40 40 { 41 41 public: 42 KillMessage( BaseObject* creator);42 KillMessage(Context* context); 43 43 virtual ~KillMessage() {} 44 44 -
code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc
r7655 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(LastManStandingInfos);39 RegisterClass(LastManStandingInfos); 40 40 41 LastManStandingInfos::LastManStandingInfos( BaseObject* creator) : OverlayText(creator)41 LastManStandingInfos::LastManStandingInfos(Context* context) : OverlayText(context) 42 42 { 43 43 RegisterObject(LastManStandingInfos); -
code/trunk/src/modules/overlays/hud/LastManStandingInfos.h
r7655 r9667 40 40 { 41 41 public: 42 LastManStandingInfos( BaseObject* creator);42 LastManStandingInfos(Context* context); 43 43 virtual ~LastManStandingInfos(); 44 44 -
code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc
r8351 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(LastTeamStandingInfos);39 RegisterClass(LastTeamStandingInfos); 40 40 41 LastTeamStandingInfos::LastTeamStandingInfos( BaseObject* creator) : OverlayText(creator)41 LastTeamStandingInfos::LastTeamStandingInfos(Context* context) : OverlayText(context) 42 42 { 43 43 RegisterObject(LastTeamStandingInfos); -
code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.h
r8178 r9667 40 40 { 41 41 public: 42 LastTeamStandingInfos( BaseObject* creator);42 LastTeamStandingInfos(Context* context); 43 43 virtual ~LastTeamStandingInfos(); 44 44 -
code/trunk/src/modules/overlays/hud/PauseNotice.cc
r8079 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(PauseNotice);36 RegisterClass(PauseNotice); 37 37 38 PauseNotice::PauseNotice( BaseObject* creator) : OverlayText(creator)38 PauseNotice::PauseNotice(Context* context) : OverlayText(context) 39 39 { 40 40 RegisterObject(PauseNotice); -
code/trunk/src/modules/overlays/hud/PauseNotice.h
r8079 r9667 40 40 { 41 41 public: 42 PauseNotice( BaseObject* creator);42 PauseNotice(Context* context); 43 43 44 44 virtual void changedOwner(); -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc
r6417 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(TeamBaseMatchScore);39 RegisterClass(TeamBaseMatchScore); 40 40 41 TeamBaseMatchScore::TeamBaseMatchScore( BaseObject* creator) : OverlayText(creator)41 TeamBaseMatchScore::TeamBaseMatchScore(Context* context) : OverlayText(context) 42 42 { 43 43 RegisterObject(TeamBaseMatchScore); -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.h
r5781 r9667 40 40 { 41 41 public: 42 TeamBaseMatchScore( BaseObject* creator);42 TeamBaseMatchScore(Context* context); 43 43 virtual ~TeamBaseMatchScore(); 44 44 -
code/trunk/src/modules/overlays/stats/Scoreboard.cc
r7401 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(Scoreboard);37 RegisterClass(Scoreboard); 38 38 39 39 /** 40 40 @brief Constructor: Creates the scoreboard. 41 41 */ 42 Scoreboard::Scoreboard( BaseObject* creator)43 : OrxonoxOverlay(c reator)42 Scoreboard::Scoreboard(Context* context) 43 : OrxonoxOverlay(context) 44 44 { 45 45 RegisterObject(Scoreboard); -
code/trunk/src/modules/overlays/stats/Scoreboard.h
r7401 r9667 41 41 { 42 42 public: // functions 43 Scoreboard( BaseObject* creator);43 Scoreboard(Context* context); 44 44 virtual ~Scoreboard(); 45 45 -
code/trunk/src/modules/overlays/stats/Stats.cc
r7401 r9667 35 35 #include "util/StringUtils.h" 36 36 #include "core/CoreIncludes.h" 37 #include "core/ ConfigValueIncludes.h"37 #include "core/config/ConfigValueIncludes.h" 38 38 39 39 namespace orxonox 40 40 { 41 CreateFactory(Stats);41 RegisterClass(Stats); 42 42 43 43 /** 44 44 @brief Constructor: Creates and initializes the Stats panel. 45 45 */ 46 Stats::Stats( BaseObject* creator)47 : OrxonoxOverlay(c reator)46 Stats::Stats(Context* context) 47 : OrxonoxOverlay(context) 48 48 , statsOverlayNoise_(0) 49 49 , statsOverlayBorder_(0) -
code/trunk/src/modules/overlays/stats/Stats.h
r7401 r9667 41 41 { 42 42 public: // functions 43 Stats( BaseObject* creator);43 Stats(Context* context); 44 44 virtual ~Stats(); 45 45 -
code/trunk/src/modules/pickup/CollectiblePickup.cc
r9348 r9667 38 38 #include "PickupCollection.h" 39 39 40 namespace orxonox { 40 namespace orxonox 41 { 42 RegisterAbstractClass(CollectiblePickup).inheritsFrom(Class(Pickupable)); 41 43 42 44 /** -
code/trunk/src/modules/pickup/Pickup.cc
r9348 r9667 48 48 /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous"; 49 49 50 CreateUnloadableFactory(Pickup);50 RegisterUnloadableClass(Pickup); 51 51 52 52 /** … … 56 56 The objects creator. 57 57 */ 58 Pickup::Pickup( BaseObject* creator) : BaseObject(creator)58 Pickup::Pickup(Context* context) : BaseObject(context) 59 59 { 60 60 RegisterObject(Pickup); … … 187 187 bool Pickup::createSpawner(void) 188 188 { 189 PickupSpawner::createDroppedPickup(this , this, this->getCarrier());189 PickupSpawner::createDroppedPickup(this->getContext(), this, this->getCarrier()); 190 190 return true; 191 191 } -
code/trunk/src/modules/pickup/Pickup.h
r9348 r9667 100 100 101 101 public: 102 Pickup( BaseObject* creator); //!< Constructor.102 Pickup(Context* context); //!< Constructor. 103 103 virtual ~Pickup(); //!< Destructor. 104 104 -
code/trunk/src/modules/pickup/PickupCollection.cc
r9348 r9667 45 45 { 46 46 47 CreateFactory(PickupCollection);47 RegisterClass(PickupCollection); 48 48 49 49 /** … … 53 53 The creator of the object. 54 54 */ 55 PickupCollection::PickupCollection( BaseObject* creator) : BaseObject(creator)55 PickupCollection::PickupCollection(Context* context) : BaseObject(context) 56 56 { 57 57 RegisterObject(PickupCollection); … … 328 328 bool PickupCollection::createSpawner(void) 329 329 { 330 PickupSpawner::createDroppedPickup(this , this, this->getCarrier());330 PickupSpawner::createDroppedPickup(this->getContext(), this, this->getCarrier()); 331 331 return true; 332 332 } -
code/trunk/src/modules/pickup/PickupCollection.h
r9348 r9667 70 70 71 71 public: 72 PickupCollection( BaseObject* creator); //!< Default Constructor.72 PickupCollection(Context* context); //!< Default Constructor. 73 73 virtual ~PickupCollection(); //!< Destructor. 74 74 -
code/trunk/src/modules/pickup/PickupManager.cc
r9348 r9667 37 37 #include "core/LuaState.h" 38 38 #include "core/GUIManager.h" 39 #include "core/ Identifier.h"39 #include "core/class/Identifier.h" 40 40 #include "network/Host.h" 41 41 #include "network/NetworkFunction.h" -
code/trunk/src/modules/pickup/PickupManager.h
r9348 r9667 39 39 40 40 #include <map> 41 #include "core/ WeakPtr.h"41 #include "core/object/WeakPtr.h" 42 42 43 43 #include "PickupRepresentation.h" -
code/trunk/src/modules/pickup/PickupRepresentation.cc
r9348 r9667 45 45 { 46 46 47 CreateFactory(PickupRepresentation);47 RegisterClass(PickupRepresentation); 48 48 49 49 /** … … 64 64 Default Constructor. Registers the object and initializes its member variables. 65 65 */ 66 PickupRepresentation::PickupRepresentation( BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL)66 PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(NULL) 67 67 { 68 68 RegisterObject(PickupRepresentation); … … 180 180 StaticEntity* PickupRepresentation::getDefaultSpawnerRepresentation(PickupSpawner* spawner) 181 181 { 182 StaticEntity* representation = new StaticEntity(spawner );183 Billboard* sphere = new Billboard(spawner );182 StaticEntity* representation = new StaticEntity(spawner->getContext()); 183 Billboard* sphere = new Billboard(spawner->getContext()); 184 184 sphere->setColour(ColourValue(0.95f, 0.85f, 0.27f)); 185 185 sphere->setMaterial("Sphere2"); 186 186 sphere->setScale(0.1f); 187 Billboard* icon = new Billboard(spawner );187 Billboard* icon = new Billboard(spawner->getContext()); 188 188 icon->setColour(ColourValue(0.89f, 0.79f, 0.08f)); 189 189 icon->setMaterial("asterisk"); -
code/trunk/src/modules/pickup/PickupRepresentation.h
r9348 r9667 95 95 public: 96 96 PickupRepresentation(); //!< Constructor 97 PickupRepresentation( BaseObject* creator); //!< Default constructor.97 PickupRepresentation(Context* context); //!< Default constructor. 98 98 virtual ~PickupRepresentation(); //!< Destructor. 99 99 -
code/trunk/src/modules/pickup/PickupSpawner.cc
r9348 r9667 47 47 { 48 48 49 CreateFactory(PickupSpawner);49 RegisterClass(PickupSpawner); 50 50 51 51 /** … … 55 55 Pointer to the object which created this item. 56 56 */ 57 PickupSpawner::PickupSpawner( BaseObject* creator) : StaticEntity(creator), pickup_(NULL), representation_(NULL), pickupTemplate_(NULL)57 PickupSpawner::PickupSpawner(Context* context) : StaticEntity(context), pickup_(NULL), representation_(NULL), pickupTemplate_(NULL) 58 58 { 59 59 RegisterObject(PickupSpawner); … … 99 99 The distance at which the PickupSpawner will trigger. 100 100 */ 101 /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup( BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance)102 { 103 PickupSpawner* spawner = new PickupSpawner(c reator);101 /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup(Context* context, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) 102 { 103 PickupSpawner* spawner = new PickupSpawner(context); 104 104 105 105 spawner->setPickupable(pickup); … … 289 289 if (identifier != NULL) 290 290 { 291 Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this ));291 Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this->getContext())); 292 292 orxonox_cast<BaseObject*>(pickup)->addTemplate(this->pickupTemplate_); 293 293 return pickup; -
code/trunk/src/modules/pickup/PickupSpawner.h
r9348 r9667 77 77 { 78 78 public: 79 PickupSpawner( BaseObject* creator); //!< Default Constructor.79 PickupSpawner(Context* context); //!< Default Constructor. 80 80 virtual ~PickupSpawner(); //!< Destructor. 81 81 82 static PickupSpawner* createDroppedPickup( BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0);82 static PickupSpawner* createDroppedPickup(Context* context, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance = 10.0); 83 83 84 84 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupSpawner through XML. -
code/trunk/src/modules/pickup/items/DamageBoostPickup.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(DamageBoostPickup);44 RegisterClass(DamageBoostPickup); 45 45 46 46 /** … … 48 48 Constructor. Registers the object and initializes the member variables. 49 49 */ 50 DamageBoostPickup::DamageBoostPickup( BaseObject* creator) : Pickup(creator)50 DamageBoostPickup::DamageBoostPickup(Context* context) : Pickup(context) 51 51 { 52 52 RegisterObject(DamageBoostPickup); -
code/trunk/src/modules/pickup/items/DamageBoostPickup.h
r9348 r9667 49 49 public: 50 50 51 DamageBoostPickup( BaseObject* creator); //!< Constructor.51 DamageBoostPickup(Context* context); //!< Constructor. 52 52 virtual ~DamageBoostPickup(); //!< Destructor. 53 53 -
code/trunk/src/modules/pickup/items/DronePickup.cc
r9348 r9667 45 45 { 46 46 47 CreateFactory(DronePickup);47 RegisterClass(DronePickup); 48 48 49 49 /** … … 51 51 Constructor. Registers the object and initializes the member variables. 52 52 */ 53 DronePickup::DronePickup( BaseObject* creator) : Pickup(creator)53 DronePickup::DronePickup(Context* context) : Pickup(context) 54 54 { 55 55 RegisterObject(DronePickup); … … 126 126 127 127 //Attach to pawn 128 Drone* drone = new Drone(pawn->getC reator()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something)128 Drone* drone = new Drone(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something) 129 129 drone->addTemplate(this->getDroneTemplate()); 130 130 -
code/trunk/src/modules/pickup/items/DronePickup.h
r9348 r9667 64 64 public: 65 65 66 DronePickup( BaseObject* creator); //!< Constructor.66 DronePickup(Context* context); //!< Constructor. 67 67 virtual ~DronePickup(); //!< Destructor. 68 68 -
code/trunk/src/modules/pickup/items/HealthPickup.cc
r9348 r9667 47 47 /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent"; 48 48 49 CreateFactory(HealthPickup);49 RegisterClass(HealthPickup); 50 50 51 51 /** … … 53 53 Constructor. Registers the object and initializes the member variables. 54 54 */ 55 HealthPickup::HealthPickup( BaseObject* creator) : Pickup(creator)55 HealthPickup::HealthPickup(Context* context) : Pickup(context) 56 56 { 57 57 RegisterObject(HealthPickup); -
code/trunk/src/modules/pickup/items/HealthPickup.h
r9348 r9667 90 90 public: 91 91 92 HealthPickup( BaseObject* creator); //!< Constructor.92 HealthPickup(Context* context); //!< Constructor. 93 93 virtual ~HealthPickup(); //!< Destructor. 94 94 -
code/trunk/src/modules/pickup/items/InvisiblePickup.cc
r9348 r9667 45 45 { 46 46 47 CreateFactory(InvisiblePickup);47 RegisterClass(InvisiblePickup); 48 48 49 49 /** … … 51 51 Constructor. Registers the object and initializes the member variables. 52 52 */ 53 InvisiblePickup::InvisiblePickup( BaseObject* creator) : Pickup(creator)53 InvisiblePickup::InvisiblePickup(Context* context) : Pickup(context) 54 54 { 55 55 RegisterObject(InvisiblePickup); -
code/trunk/src/modules/pickup/items/InvisiblePickup.h
r9348 r9667 70 70 public: 71 71 72 InvisiblePickup( BaseObject* creator); //!< Constructor.72 InvisiblePickup(Context* context); //!< Constructor. 73 73 virtual ~InvisiblePickup(); //!< Destructor. 74 74 -
code/trunk/src/modules/pickup/items/MetaPickup.cc
r9348 r9667 42 42 namespace orxonox { 43 43 44 CreateFactory(MetaPickup);44 RegisterClass(MetaPickup); 45 45 46 46 //! Setting the static variables to their values. … … 55 55 Constructor. Registers and initializes the object. 56 56 */ 57 MetaPickup::MetaPickup( BaseObject* creator) : Pickup(creator)57 MetaPickup::MetaPickup(Context* context) : Pickup(context) 58 58 { 59 59 RegisterObject(MetaPickup); -
code/trunk/src/modules/pickup/items/MetaPickup.h
r9348 r9667 89 89 90 90 public: 91 MetaPickup( BaseObject* creator); //!< Constructor. Registers and initializes the object.91 MetaPickup(Context* context); //!< Constructor. Registers and initializes the object. 92 92 virtual ~MetaPickup(); //!< Destructor. 93 93 -
code/trunk/src/modules/pickup/items/ShieldPickup.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(ShieldPickup);44 RegisterClass(ShieldPickup); 45 45 46 46 /** … … 48 48 Constructor. Registers the object and initializes the member variables. 49 49 */ 50 ShieldPickup::ShieldPickup( BaseObject* creator) : Pickup(creator)50 ShieldPickup::ShieldPickup(Context* context) : Pickup(context) 51 51 { 52 52 RegisterObject(ShieldPickup); -
code/trunk/src/modules/pickup/items/ShieldPickup.h
r9348 r9667 76 76 public: 77 77 78 ShieldPickup( BaseObject* creator); //!< Constructor.78 ShieldPickup(Context* context); //!< Constructor. 79 79 virtual ~ShieldPickup(); //!< Destructor. 80 80 -
code/trunk/src/modules/pickup/items/ShrinkPickup.cc
r9348 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(ShrinkPickup);48 RegisterClass(ShrinkPickup); 49 49 50 50 /** … … 52 52 Constructor: Initializes the Pickup. 53 53 */ 54 ShrinkPickup::ShrinkPickup( BaseObject* creator) : Pickup(creator)54 ShrinkPickup::ShrinkPickup(Context* context) : Pickup(context) 55 55 { 56 56 RegisterObject(ShrinkPickup); -
code/trunk/src/modules/pickup/items/ShrinkPickup.h
r9348 r9667 72 72 { 73 73 public: 74 ShrinkPickup( BaseObject* creator); // Constructor.74 ShrinkPickup(Context* context); // Constructor. 75 75 virtual ~ShrinkPickup(); // Destructor. 76 76 -
code/trunk/src/modules/pickup/items/SpeedPickup.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(SpeedPickup);44 RegisterClass(SpeedPickup); 45 45 46 46 /** … … 48 48 Constructor. Registers the object and initializes the member variables. 49 49 */ 50 SpeedPickup::SpeedPickup( BaseObject* creator) : Pickup(creator)50 SpeedPickup::SpeedPickup(Context* context) : Pickup(context) 51 51 { 52 52 RegisterObject(SpeedPickup); -
code/trunk/src/modules/pickup/items/SpeedPickup.h
r9348 r9667 75 75 public: 76 76 77 SpeedPickup( BaseObject* creator); //!< Constructor.77 SpeedPickup(Context* context); //!< Constructor. 78 78 virtual ~SpeedPickup(); //!< Destructor. 79 79 -
code/trunk/src/modules/pong/Pong.cc
r9348 r9667 37 37 #include "core/EventIncludes.h" 38 38 #include "core/command/Executor.h" 39 #include "core/ ConfigValueIncludes.h"39 #include "core/config/ConfigValueIncludes.h" 40 40 41 41 #include "gamestates/GSLevel.h" … … 53 53 CreateEventName(PongCenterpoint, left); 54 54 55 CreateUnloadableFactory(Pong);55 RegisterUnloadableClass(Pong); 56 56 57 57 /** … … 59 59 Constructor. Registers and initializes the object. 60 60 */ 61 Pong::Pong( BaseObject* creator) : Deathmatch(creator)61 Pong::Pong(Context* context) : Deathmatch(context) 62 62 { 63 63 RegisterObject(Pong); … … 129 129 if (this->ball_ == NULL) // If there is no ball, create a new ball. 130 130 { 131 this->ball_ = new PongBall(this->center_ );131 this->ball_ = new PongBall(this->center_->getContext()); 132 132 // Apply the template for the ball specified by the centerpoint. 133 133 this->ball_->addTemplate(this->center_->getBalltemplate()); … … 147 147 if (this->bat_[i] == NULL) 148 148 { 149 this->bat_[i] = new PongBat(this->center_ );149 this->bat_[i] = new PongBat(this->center_->getContext()); 150 150 this->bat_[i]->addTemplate(this->center_->getBattemplate()); 151 151 } -
code/trunk/src/modules/pong/Pong.h
r9348 r9667 65 65 { 66 66 public: 67 Pong( BaseObject* creator); //!< Constructor. Registers and initializes the object.67 Pong(Context* context); //!< Constructor. Registers and initializes the object. 68 68 virtual ~Pong(); //!< Destructor. Cleans up, if initialized. 69 69 -
code/trunk/src/modules/pong/PongAI.cc
r8952 r9667 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/ ConfigValueIncludes.h"37 #include "core/config/ConfigValueIncludes.h" 38 38 #include "core/command/Executor.h" 39 39 #include "tools/Timer.h" … … 45 45 namespace orxonox 46 46 { 47 CreateUnloadableFactory(PongAI);47 RegisterUnloadableClass(PongAI); 48 48 49 49 const static float MAX_REACTION_TIME = 0.4f; … … 53 53 Constructor. Registers and initializes the object. 54 54 */ 55 PongAI::PongAI( BaseObject* creator) : Controller(creator)55 PongAI::PongAI(Context* context) : Controller(context) 56 56 { 57 57 RegisterObject(PongAI); -
code/trunk/src/modules/pong/PongAI.h
r9016 r9667 44 44 45 45 #include "controllers/Controller.h" 46 #include "PongBall.h" 46 47 47 48 namespace orxonox … … 60 61 { 61 62 public: 62 PongAI( BaseObject* creator); //!< Constructor. Registers and initializes the object.63 PongAI(Context* context); //!< Constructor. Registers and initializes the object. 63 64 virtual ~PongAI(); 64 65 -
code/trunk/src/modules/pong/PongBall.cc
r8108 r9667 43 43 namespace orxonox 44 44 { 45 CreateFactory(PongBall);45 RegisterClass(PongBall); 46 46 47 47 const float PongBall::MAX_REL_Z_VELOCITY = 1.5; … … 51 51 Constructor. Registers and initializes the object. 52 52 */ 53 PongBall::PongBall( BaseObject* creator)54 : MovableEntity(c reator)53 PongBall::PongBall(Context* context) 54 : MovableEntity(context) 55 55 { 56 56 RegisterObject(PongBall); -
code/trunk/src/modules/pong/PongBall.h
r8108 r9667 59 59 { 60 60 public: 61 PongBall( BaseObject* creator);61 PongBall(Context* context); 62 62 virtual ~PongBall(); 63 63 -
code/trunk/src/modules/pong/PongBat.cc
r8108 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(PongBat);41 RegisterClass(PongBat); 42 42 43 43 /** … … 45 45 Constructor. Registers and initializes the object. 46 46 */ 47 PongBat::PongBat( BaseObject* creator) : ControllableEntity(creator)47 PongBat::PongBat(Context* context) : ControllableEntity(context) 48 48 { 49 49 RegisterObject(PongBat); -
code/trunk/src/modules/pong/PongBat.h
r8706 r9667 57 57 { 58 58 public: 59 PongBat( BaseObject* creator); //!< Constructor. Registers and initializes the object.59 PongBat(Context* context); //!< Constructor. Registers and initializes the object. 60 60 virtual ~PongBat() {} 61 61 -
code/trunk/src/modules/pong/PongBot.cc
r8108 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(PongBot);41 RegisterClass(PongBot); 42 42 43 43 /** … … 45 45 Constructor. Registers the object and creates a PongAI controller. 46 46 */ 47 PongBot::PongBot( BaseObject* creator) : Bot(creator)47 PongBot::PongBot(Context* context) : Bot(context) 48 48 { 49 49 RegisterObject(PongBot); -
code/trunk/src/modules/pong/PongBot.h
r8108 r9667 56 56 { 57 57 public: 58 PongBot( BaseObject* creator);58 PongBot(Context* context); 59 59 virtual ~PongBot() {} 60 60 }; -
code/trunk/src/modules/pong/PongCenterpoint.cc
r8108 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(PongCenterpoint);43 RegisterClass(PongCenterpoint); 44 44 45 45 /** … … 47 47 Constructor. Registers and initializes the object and checks whether the gametype is actually Pong. 48 48 */ 49 PongCenterpoint::PongCenterpoint( BaseObject* creator) : StaticEntity(creator)49 PongCenterpoint::PongCenterpoint(Context* context) : StaticEntity(context) 50 50 { 51 51 RegisterObject(PongCenterpoint); -
code/trunk/src/modules/pong/PongCenterpoint.h
r8108 r9667 121 121 { 122 122 public: 123 PongCenterpoint( BaseObject* creator); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.123 PongCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong. 124 124 virtual ~PongCenterpoint() {} 125 125 -
code/trunk/src/modules/pong/PongScore.cc
r9264 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(PongScore);46 RegisterClass(PongScore); 47 47 48 48 /** … … 50 50 Constructor. Registers and initializes the object. 51 51 */ 52 PongScore::PongScore( BaseObject* creator) : OverlayText(creator)52 PongScore::PongScore(Context* context) : OverlayText(context) 53 53 { 54 54 RegisterObject(PongScore); -
code/trunk/src/modules/pong/PongScore.h
r9258 r9667 57 57 { 58 58 public: 59 PongScore( BaseObject* creator);59 PongScore(Context* context); 60 60 virtual ~PongScore(); 61 61 -
code/trunk/src/modules/portals/PortalEndPoint.cc
r9526 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(PortalEndPoint);44 RegisterClass(PortalEndPoint); 45 45 46 46 /*static*/ const std::string PortalEndPoint::EVENTFUNCTIONNAME = "execute"; … … 48 48 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; 49 49 50 PortalEndPoint::PortalEndPoint( BaseObject* creator) : StaticEntity(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)), id_(0), trigger_(NULL), reenterDelay_(0)50 PortalEndPoint::PortalEndPoint(Context* context) : StaticEntity(context), RadarViewable(this, static_cast<WorldEntity*>(this)), id_(0), trigger_(NULL), reenterDelay_(0) 51 51 { 52 52 RegisterObject(PortalEndPoint); 53 53 54 this->trigger_ = new DistanceMultiTrigger(this );54 this->trigger_ = new DistanceMultiTrigger(this->getContext()); 55 55 this->trigger_->setName("portal"); 56 56 this->attach(this->trigger_); … … 61 61 if( GameMode::isMaster() ) 62 62 { 63 this->portalSound_ = new WorldSound(this );63 this->portalSound_ = new WorldSound(this->getContext()); 64 64 this->portalSound_->setLooping(false); 65 65 this->attach(this->portalSound_); -
code/trunk/src/modules/portals/PortalEndPoint.h
r9526 r9667 60 60 { 61 61 public: 62 PortalEndPoint( BaseObject* creator);62 PortalEndPoint(Context* context); 63 63 virtual ~PortalEndPoint(); 64 64 -
code/trunk/src/modules/portals/PortalLink.cc
r8767 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(PortalLink);38 RegisterClass(PortalLink); 39 39 40 40 std::map<PortalEndPoint *, PortalEndPoint *> PortalLink::links_s; 41 41 42 PortalLink::PortalLink( BaseObject* creator) : BaseObject(creator), fromID_(0), toID_(0), from_(0), to_(0)42 PortalLink::PortalLink(Context* context) : BaseObject(context), fromID_(0), toID_(0), from_(0), to_(0) 43 43 { 44 44 RegisterObject(PortalLink); -
code/trunk/src/modules/portals/PortalLink.h
r8767 r9667 54 54 { 55 55 public: 56 PortalLink( BaseObject* creator);56 PortalLink(Context* context); 57 57 virtual ~PortalLink(); 58 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/modules/questsystem/GlobalQuest.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(GlobalQuest);43 RegisterClass(GlobalQuest); 44 44 45 45 /** … … 47 47 Constructor. Registers the object. 48 48 */ 49 GlobalQuest::GlobalQuest( BaseObject* creator) : Quest(creator)49 GlobalQuest::GlobalQuest(Context* context) : Quest(context) 50 50 { 51 51 RegisterObject(GlobalQuest); -
code/trunk/src/modules/questsystem/GlobalQuest.h
r7552 r9667 90 90 { 91 91 public: 92 GlobalQuest( BaseObject* creator);92 GlobalQuest(Context* context); 93 93 virtual ~GlobalQuest(); 94 94 -
code/trunk/src/modules/questsystem/LocalQuest.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(LocalQuest);43 RegisterClass(LocalQuest); 44 44 45 45 /** … … 47 47 Constructor. Registers and initializes the object. 48 48 */ 49 LocalQuest::LocalQuest( BaseObject* creator) : Quest(creator)49 LocalQuest::LocalQuest(Context* context) : Quest(context) 50 50 { 51 51 RegisterObject(LocalQuest); -
code/trunk/src/modules/questsystem/LocalQuest.h
r7552 r9667 84 84 { 85 85 public: 86 LocalQuest( BaseObject* creator);86 LocalQuest(Context* context); 87 87 virtual ~LocalQuest(); 88 88 -
code/trunk/src/modules/questsystem/Quest.cc
r8858 r9667 45 45 namespace orxonox 46 46 { 47 RegisterAbstractClass(Quest).inheritsFrom(Class(QuestItem)); 48 47 49 /** 48 50 @brief 49 51 Constructor. Registers and initializes object. 50 52 */ 51 Quest::Quest( BaseObject* creator) : QuestItem(creator)53 Quest::Quest(Context* context) : QuestItem(context) 52 54 { 53 55 RegisterObject(Quest); -
code/trunk/src/modules/questsystem/Quest.h
r7552 r9667 82 82 { // tolua_export 83 83 public: 84 Quest( BaseObject* creator);84 Quest(Context* context); 85 85 virtual ~Quest(); 86 86 -
code/trunk/src/modules/questsystem/QuestDescription.cc
r8858 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(QuestDescription);46 RegisterClass(QuestDescription); 47 47 48 48 /*static*/ const std::string QuestDescription::SENDER = "questsystem"; … … 52 52 Constructor. Registers and initializes the object. 53 53 */ 54 QuestDescription::QuestDescription( BaseObject* creator) : BaseObject(creator)54 QuestDescription::QuestDescription(Context* context) : BaseObject(context) 55 55 { 56 56 RegisterObject(QuestDescription); -
code/trunk/src/modules/questsystem/QuestDescription.h
r7552 r9667 64 64 // tolua_end 65 65 public: 66 QuestDescription( BaseObject* creator);66 QuestDescription(Context* context); 67 67 virtual ~QuestDescription(); 68 68 -
code/trunk/src/modules/questsystem/QuestEffect.cc
r8858 r9667 37 37 namespace orxonox 38 38 { 39 RegisterAbstractClass(QuestEffect).inheritsFrom(Class(BaseObject)); 40 39 41 /** 40 42 @brief … … 42 44 Is not meant to be invoked directly, since this is only an interface. 43 45 */ 44 QuestEffect::QuestEffect( BaseObject* creator) : BaseObject(creator)46 QuestEffect::QuestEffect(Context* context) : BaseObject(context) 45 47 { 46 48 RegisterObject(QuestEffect); -
code/trunk/src/modules/questsystem/QuestEffect.h
r7552 r9667 57 57 { 58 58 public: 59 QuestEffect( BaseObject* creator);59 QuestEffect(Context* context); 60 60 virtual ~QuestEffect(); 61 61 -
code/trunk/src/modules/questsystem/QuestEffectBeacon.cc
r8858 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(QuestEffectBeacon);47 RegisterClass(QuestEffectBeacon); 48 48 49 49 /** … … 51 51 Constructor. Registers the object and initializes defaults. 52 52 */ 53 QuestEffectBeacon::QuestEffectBeacon( BaseObject* creator) : StaticEntity(creator)53 QuestEffectBeacon::QuestEffectBeacon(Context* context) : StaticEntity(context) 54 54 { 55 55 RegisterObject(QuestEffectBeacon); -
code/trunk/src/modules/questsystem/QuestEffectBeacon.h
r7552 r9667 93 93 { 94 94 public: 95 QuestEffectBeacon( BaseObject* creator);95 QuestEffectBeacon(Context* context); 96 96 virtual ~QuestEffectBeacon(); 97 97 -
code/trunk/src/modules/questsystem/QuestHint.cc
r8858 r9667 43 43 namespace orxonox 44 44 { 45 CreateFactory(QuestHint);45 RegisterClass(QuestHint); 46 46 47 47 /** … … 49 49 Constructor. Registers the object. 50 50 */ 51 QuestHint::QuestHint( BaseObject* creator) : QuestItem(creator)51 QuestHint::QuestHint(Context* context) : QuestItem(context) 52 52 { 53 53 RegisterObject(QuestHint); -
code/trunk/src/modules/questsystem/QuestHint.h
r7552 r9667 82 82 83 83 public: 84 QuestHint( BaseObject* creator);84 QuestHint(Context* context); 85 85 virtual ~QuestHint(); 86 86 -
code/trunk/src/modules/questsystem/QuestItem.cc
r8858 r9667 42 42 { 43 43 44 CreateUnloadableFactory(QuestItem);44 RegisterUnloadableClass(QuestItem); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 QuestItem::QuestItem( BaseObject* creator) : BaseObject(creator)50 QuestItem::QuestItem(Context* context) : BaseObject(context) 51 51 { 52 52 this->registered_ = false; -
code/trunk/src/modules/questsystem/QuestItem.h
r8891 r9667 60 60 61 61 public: 62 QuestItem( BaseObject* creator);62 QuestItem(Context* context); 63 63 virtual ~QuestItem(); 64 64 -
code/trunk/src/modules/questsystem/QuestListener.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(QuestListener);44 RegisterClass(QuestListener); 45 45 46 46 // Initialization of the static variables for the modes as strings. … … 54 54 Constructor. Registers the object and initializes variables. 55 55 */ 56 QuestListener::QuestListener( BaseObject* creator) : BaseObject(creator)56 QuestListener::QuestListener(Context* context) : BaseObject(context) 57 57 { 58 58 RegisterObject(QuestListener); -
code/trunk/src/modules/questsystem/QuestListener.h
r7552 r9667 87 87 88 88 public: 89 QuestListener( BaseObject* creator);89 QuestListener(Context* context); 90 90 virtual ~QuestListener(); 91 91 -
code/trunk/src/modules/questsystem/QuestManager.cc
r8952 r9667 38 38 #include "util/ScopedSingletonManager.h" 39 39 #include "core/command/ConsoleCommand.h" 40 #include "core/CoreIncludes.h"41 40 #include "core/GUIManager.h" 42 41 #include "core/LuaState.h" … … 60 59 QuestManager::QuestManager() 61 60 { 62 RegisterRootObject(QuestManager);63 61 orxout(internal_info, context::quests) << "QuestManager created." << endl; 64 62 } -
code/trunk/src/modules/questsystem/QuestManager.h
r8706 r9667 43 43 44 44 #include "util/Singleton.h" 45 #include "core/OrxonoxClass.h"46 45 47 46 namespace orxonox // tolua_export … … 59 58 */ 60 59 class _QuestsystemExport QuestManager // tolua_export 61 : public Singleton<QuestManager> , public orxonox::OrxonoxClass60 : public Singleton<QuestManager> 62 61 { // tolua_export 63 62 -
code/trunk/src/modules/questsystem/effects/AddQuest.cc
r8858 r9667 43 43 namespace orxonox 44 44 { 45 CreateFactory(AddQuest);45 RegisterClass(AddQuest); 46 46 47 47 /** … … 49 49 Constructor. Registers the object. 50 50 */ 51 AddQuest::AddQuest( BaseObject* creator) : ChangeQuestStatus(creator)51 AddQuest::AddQuest(Context* context) : ChangeQuestStatus(context) 52 52 { 53 53 RegisterObject(AddQuest); -
code/trunk/src/modules/questsystem/effects/AddQuest.h
r7552 r9667 59 59 { 60 60 public: 61 AddQuest( BaseObject* creator);61 AddQuest(Context* context); 62 62 virtual ~AddQuest(); 63 63 -
code/trunk/src/modules/questsystem/effects/AddQuestHint.cc
r8858 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(AddQuestHint);46 RegisterClass(AddQuestHint); 47 47 48 48 /** … … 50 50 Constructor. Registers the object. 51 51 */ 52 AddQuestHint::AddQuestHint( BaseObject* creator) : QuestEffect(creator)52 AddQuestHint::AddQuestHint(Context* context) : QuestEffect(context) 53 53 { 54 54 RegisterObject(AddQuestHint); -
code/trunk/src/modules/questsystem/effects/AddQuestHint.h
r7552 r9667 61 61 { 62 62 public: 63 AddQuestHint( BaseObject* creator);63 AddQuestHint(Context* context); 64 64 virtual ~AddQuestHint(); 65 65 -
code/trunk/src/modules/questsystem/effects/AddReward.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(AddReward);43 RegisterClass(AddReward); 44 44 45 45 /** … … 47 47 Constructor. Registers the object. 48 48 */ 49 AddReward::AddReward( BaseObject* creator) : QuestEffect(creator)49 AddReward::AddReward(Context* context) : QuestEffect(context) 50 50 { 51 51 RegisterObject(AddReward); -
code/trunk/src/modules/questsystem/effects/AddReward.h
r7552 r9667 65 65 { 66 66 public: 67 AddReward( BaseObject* creator);67 AddReward(Context* context); 68 68 virtual ~AddReward(); 69 69 -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 RegisterAbstractClass(ChangeQuestStatus).inheritsFrom(Class(QuestEffect)); 45 44 46 /** 45 47 @brief 46 48 Constructor. Registers the object. 47 49 */ 48 ChangeQuestStatus::ChangeQuestStatus( BaseObject* creator) : QuestEffect(creator)50 ChangeQuestStatus::ChangeQuestStatus(Context* context) : QuestEffect(context) 49 51 { 50 52 RegisterObject(ChangeQuestStatus); -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h
r7552 r9667 56 56 { 57 57 public: 58 ChangeQuestStatus( BaseObject* creator);58 ChangeQuestStatus(Context* context); 59 59 virtual ~ChangeQuestStatus(); 60 60 -
code/trunk/src/modules/questsystem/effects/CompleteQuest.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(CompleteQuest);44 RegisterClass(CompleteQuest); 45 45 46 46 /** … … 48 48 Constructor. Registers the object. 49 49 */ 50 CompleteQuest::CompleteQuest( BaseObject* creator) : ChangeQuestStatus(creator)50 CompleteQuest::CompleteQuest(Context* context) : ChangeQuestStatus(context) 51 51 { 52 52 RegisterObject(CompleteQuest); -
code/trunk/src/modules/questsystem/effects/CompleteQuest.h
r7552 r9667 59 59 { 60 60 public: 61 CompleteQuest( BaseObject* creator);61 CompleteQuest(Context* context); 62 62 virtual ~CompleteQuest(); 63 63 -
code/trunk/src/modules/questsystem/effects/FailQuest.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(FailQuest);44 RegisterClass(FailQuest); 45 45 46 46 /** … … 48 48 Constructor. Registers the object. 49 49 */ 50 FailQuest::FailQuest( BaseObject* creator) : ChangeQuestStatus(creator)50 FailQuest::FailQuest(Context* context) : ChangeQuestStatus(context) 51 51 { 52 52 RegisterObject(FailQuest); -
code/trunk/src/modules/questsystem/effects/FailQuest.h
r7552 r9667 59 59 { 60 60 public: 61 FailQuest( BaseObject* creator);61 FailQuest(Context* context); 62 62 virtual ~FailQuest(); 63 63 -
code/trunk/src/modules/tetris/Tetris.cc
r9348 r9667 54 54 { 55 55 56 CreateUnloadableFactory(Tetris);56 RegisterUnloadableClass(Tetris); 57 57 58 58 /** … … 61 61 @ingroup Tetris 62 62 */ 63 Tetris::Tetris( BaseObject* creator) : Deathmatch(creator)63 Tetris::Tetris(Context* context) : Deathmatch(context) 64 64 { 65 65 RegisterObject(Tetris); … … 379 379 { 380 380 // create new futureBrick_ 381 this->futureBrick_ = new TetrisBrick(this->center_ );381 this->futureBrick_ = new TetrisBrick(this->center_->getContext()); 382 382 383 383 -
code/trunk/src/modules/tetris/Tetris.h
r9348 r9667 55 55 { 56 56 public: 57 Tetris( BaseObject* creator); //!< Constructor. Registers and initializes the object.57 Tetris(Context* context); //!< Constructor. Registers and initializes the object. 58 58 virtual ~Tetris(); //!< Destructor. Cleans up, if initialized. 59 59 -
code/trunk/src/modules/tetris/TetrisBrick.cc
r9348 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(TetrisBrick);46 RegisterClass(TetrisBrick); 47 47 48 48 /** … … 51 51 @ingroup Tetris 52 52 */ 53 TetrisBrick::TetrisBrick( BaseObject* creator): ControllableEntity(creator)53 TetrisBrick::TetrisBrick(Context* context): ControllableEntity(context) 54 54 { 55 55 RegisterObject(TetrisBrick); … … 77 77 { 78 78 // Create a new stone and add it to the brick. 79 TetrisStone* stone = new TetrisStone(this );79 TetrisStone* stone = new TetrisStone(this->getContext()); 80 80 this->brickStones_.push_back(stone); 81 81 this->attach(stone); -
code/trunk/src/modules/tetris/TetrisBrick.h
r9348 r9667 54 54 { 55 55 public: 56 TetrisBrick( BaseObject* creator); //!< Constructor. Registers and initializes the object.56 TetrisBrick(Context* context); //!< Constructor. Registers and initializes the object. 57 57 virtual ~TetrisBrick() {} 58 58 -
code/trunk/src/modules/tetris/TetrisCenterpoint.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(TetrisCenterpoint);44 RegisterClass(TetrisCenterpoint); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object and checks whether the gametype is actually Tetris. 49 49 */ 50 TetrisCenterpoint::TetrisCenterpoint( BaseObject* creator) : StaticEntity(creator)50 TetrisCenterpoint::TetrisCenterpoint(Context* context) : StaticEntity(context) 51 51 { 52 52 RegisterObject(TetrisCenterpoint); -
code/trunk/src/modules/tetris/TetrisCenterpoint.h
r9348 r9667 59 59 { 60 60 public: 61 TetrisCenterpoint( BaseObject* creator); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Tetris.61 TetrisCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Tetris. 62 62 virtual ~TetrisCenterpoint() {} 63 63 -
code/trunk/src/modules/tetris/TetrisScore.cc
r9348 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(TetrisScore);47 RegisterClass(TetrisScore); 48 48 49 49 /** … … 52 52 @ingroup Tetris 53 53 */ 54 TetrisScore::TetrisScore( BaseObject* creator) : OverlayText(creator)54 TetrisScore::TetrisScore(Context* context) : OverlayText(context) 55 55 { 56 56 RegisterObject(TetrisScore); -
code/trunk/src/modules/tetris/TetrisScore.h
r9348 r9667 57 57 { 58 58 public: 59 TetrisScore( BaseObject* creator);59 TetrisScore(Context* context); 60 60 virtual ~TetrisScore(); 61 61 -
code/trunk/src/modules/tetris/TetrisStone.cc
r9348 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(TetrisStone);44 RegisterClass(TetrisStone); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 TetrisStone::TetrisStone( BaseObject* creator) : MovableEntity(creator)50 TetrisStone::TetrisStone(Context* context) : MovableEntity(context) 51 51 { 52 52 RegisterObject(TetrisStone); -
code/trunk/src/modules/tetris/TetrisStone.h
r9348 r9667 54 54 { 55 55 public: 56 TetrisStone( BaseObject* creator); //!< Constructor. Registers and initializes the object.56 TetrisStone(Context* context); //!< Constructor. Registers and initializes the object. 57 57 virtual ~TetrisStone() {} 58 58 -
code/trunk/src/modules/towerdefense/Tower.cc
r9272 r9667 16 16 namespace orxonox 17 17 { 18 CreateFactory(Tower);18 RegisterClass(Tower); 19 19 20 20 /** … … 22 22 Constructor. Registers and initializes the object. 23 23 */ 24 Tower::Tower( BaseObject* creator) : Pawn(creator)24 Tower::Tower(Context* context) : Pawn(context) 25 25 { 26 26 RegisterObject(Tower); -
code/trunk/src/modules/towerdefense/Tower.h
r9272 r9667 27 27 { 28 28 public: 29 Tower( BaseObject* creator);29 Tower(Context* context); 30 30 virtual ~Tower() {}; 31 31 -
code/trunk/src/modules/towerdefense/TowerDefense.cc
r9347 r9667 87 87 88 88 #include "chat/ChatManager.h" 89 #include "core/CoreIncludes.h" 89 90 90 91 /* Part of a temporary hack to allow the player to add towers */ … … 93 94 namespace orxonox 94 95 { 95 CreateUnloadableFactory(TowerDefense);96 97 TowerDefense::TowerDefense( BaseObject* creator) : Deathmatch(creator)96 RegisterUnloadableClass(TowerDefense); 97 98 TowerDefense::TowerDefense(Context* context) : Deathmatch(context) 98 99 { 99 100 RegisterObject(TowerDefense); … … 189 190 190 191 // Create tower 191 Tower* newTower = new Tower(this->center_ );192 Tower* newTower = new Tower(this->center_->getContext()); 192 193 newTower->addTemplate(this->center_->getTowerTemplate()); 193 194 -
code/trunk/src/modules/towerdefense/TowerDefense.h
r9347 r9667 48 48 { 49 49 public: 50 TowerDefense( BaseObject* creator);50 TowerDefense(Context* context); 51 51 virtual ~TowerDefense(); 52 52 -
code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc
r9272 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(TowerDefenseCenterpoint);43 RegisterClass(TowerDefenseCenterpoint); 44 44 45 45 /** … … 47 47 Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense. 48 48 */ 49 TowerDefenseCenterpoint::TowerDefenseCenterpoint( BaseObject* creator) : MobileEntity(creator)49 TowerDefenseCenterpoint::TowerDefenseCenterpoint(Context* context) : MobileEntity(context) 50 50 { 51 51 RegisterObject(TowerDefenseCenterpoint); -
code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h
r9272 r9667 49 49 { 50 50 public: 51 TowerDefenseCenterpoint( BaseObject* creator);51 TowerDefenseCenterpoint(Context* context); 52 52 virtual ~TowerDefenseCenterpoint() {} 53 53 -
code/trunk/src/modules/towerdefense/TowerDefenseController.cc
r9271 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(TowerDefenseController);38 RegisterClass(TowerDefenseController); 39 39 40 TowerDefenseController::TowerDefenseController( BaseObject* creator) : WaypointController(creator)40 TowerDefenseController::TowerDefenseController(Context* context) : WaypointController(context) 41 41 { 42 42 RegisterObject(TowerDefenseController); -
code/trunk/src/modules/towerdefense/TowerDefenseController.h
r9271 r9667 40 40 { 41 41 public: 42 TowerDefenseController( BaseObject* creator);42 TowerDefenseController(Context* context); 43 43 virtual ~TowerDefenseController() {} 44 44 -
code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc
r9272 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(TowerDefenseHUDController);37 RegisterClass(TowerDefenseHUDController); 38 38 39 TowerDefenseHUDController::TowerDefenseHUDController( BaseObject* creator) : OverlayText(creator)39 TowerDefenseHUDController::TowerDefenseHUDController(Context* context) : OverlayText(context) 40 40 { 41 41 RegisterObject(TowerDefenseHUDController); -
code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h
r9272 r9667 49 49 { 50 50 public: 51 TowerDefenseHUDController( BaseObject* creator);51 TowerDefenseHUDController(Context* context); 52 52 virtual ~TowerDefenseHUDController(); 53 53 -
code/trunk/src/modules/weapons/MuzzleFlash.cc
r8855 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(MuzzleFlash);41 RegisterClass(MuzzleFlash); 42 42 43 MuzzleFlash::MuzzleFlash( BaseObject* creator) : Billboard(creator)43 MuzzleFlash::MuzzleFlash(Context* context) : Billboard(context) 44 44 { 45 45 RegisterObject(MuzzleFlash); -
code/trunk/src/modules/weapons/MuzzleFlash.h
r8855 r9667 55 55 { 56 56 public: 57 MuzzleFlash( BaseObject* creator);57 MuzzleFlash(Context* context); 58 58 virtual ~MuzzleFlash() {} 59 59 -
code/trunk/src/modules/weapons/RocketController.cc
r9348 r9667 45 45 Constructor. 46 46 */ 47 RocketController::RocketController( BaseObject* creator) : Controller(creator)47 RocketController::RocketController(Context* context) : Controller(context) 48 48 { 49 49 RegisterObject(RocketController); … … 51 51 52 52 // Create a rocket for the controller. 53 this->rocket_ = new SimpleRocket(this );53 this->rocket_ = new SimpleRocket(this->getContext()); 54 54 this->rocket_->setController(this); 55 55 this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_)); -
code/trunk/src/modules/weapons/RocketController.h
r8855 r9667 52 52 { 53 53 public: 54 RocketController( BaseObject* creator);54 RocketController(Context* context); 55 55 virtual ~RocketController(); 56 56 -
code/trunk/src/modules/weapons/munitions/FusionMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(FusionMunition);39 RegisterClass(FusionMunition); 40 40 41 FusionMunition::FusionMunition( BaseObject* creator) : Munition(creator)41 FusionMunition::FusionMunition(Context* context) : Munition(context) 42 42 { 43 43 RegisterObject(FusionMunition); -
code/trunk/src/modules/weapons/munitions/FusionMunition.h
r8855 r9667 51 51 { 52 52 public: 53 FusionMunition( BaseObject* creator);53 FusionMunition(Context* context); 54 54 virtual ~FusionMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/munitions/LaserMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(LaserMunition);39 RegisterClass(LaserMunition); 40 40 41 LaserMunition::LaserMunition( BaseObject* creator) : ReplenishingMunition(creator)41 LaserMunition::LaserMunition(Context* context) : ReplenishingMunition(context) 42 42 { 43 43 RegisterObject(LaserMunition); -
code/trunk/src/modules/weapons/munitions/LaserMunition.h
r8855 r9667 51 51 { 52 52 public: 53 LaserMunition( BaseObject* creator);53 LaserMunition(Context* context); 54 54 virtual ~LaserMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc
r8855 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(ReplenishingMunition);41 RegisterClass(ReplenishingMunition); 42 42 43 ReplenishingMunition::ReplenishingMunition( BaseObject* creator) : Munition(creator)43 ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context) 44 44 { 45 45 RegisterObject(ReplenishingMunition); -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h
r8855 r9667 53 53 { 54 54 public: 55 ReplenishingMunition( BaseObject* creator);55 ReplenishingMunition(Context* context); 56 56 virtual ~ReplenishingMunition() {} 57 57 -
code/trunk/src/modules/weapons/munitions/RocketMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(RocketMunition);39 RegisterClass(RocketMunition); 40 40 41 RocketMunition::RocketMunition( BaseObject* creator) : Munition(creator)41 RocketMunition::RocketMunition(Context* context) : Munition(context) 42 42 { 43 43 RegisterObject(RocketMunition); -
code/trunk/src/modules/weapons/munitions/RocketMunition.h
r8855 r9667 51 51 { 52 52 public: 53 RocketMunition( BaseObject* creator);53 RocketMunition(Context* context); 54 54 virtual ~RocketMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
r8855 r9667 42 42 namespace orxonox 43 43 { 44 RegisterClassNoArgs(BasicProjectile); 45 44 46 /** 45 47 @brief 46 48 Constructor. Registers the object and initializes some default values. 47 49 */ 48 BasicProjectile::BasicProjectile() : OrxonoxClass()50 BasicProjectile::BasicProjectile() 49 51 { 50 Register RootObject(BasicProjectile);// Register the BasicProjectile class to the core52 RegisterObject(BasicProjectile);// Register the BasicProjectile class to the core 51 53 52 54 this->bDestroy_ = false; … … 106 108 { 107 109 { 108 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());110 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 109 111 effect->setPosition(entity->getPosition()); 110 112 effect->setOrientation(entity->getOrientation()); … … 115 117 // Second effect with same condition 116 118 { 117 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());119 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 118 120 effect->setPosition(entity->getPosition()); 119 121 effect->setOrientation(entity->getOrientation()); … … 127 129 if (victim && victim->hasShield() && (this->getDamage() > 0.0f || this->getShieldDamage() > 0.0f) && victim->getHealth() > 0.0f) 128 130 { 129 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());131 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 130 132 effect->setDestroyAfterLife(true); 131 133 effect->setSource("Orxonox/Shield"); -
code/trunk/src/modules/weapons/projectiles/BasicProjectile.h
r8858 r9667 39 39 #include "worldentities/pawns/Pawn.h" 40 40 41 #include "core/ OrxonoxClass.h"41 #include "core/class/OrxonoxInterface.h" 42 42 43 43 namespace orxonox … … 52 52 @ingroup WeaponsProjectiles 53 53 */ 54 class _WeaponsExport BasicProjectile : public virtual Orxonox Class54 class _WeaponsExport BasicProjectile : public virtual OrxonoxInterface 55 55 { 56 56 public: -
code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc
r8855 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(BillboardProjectile);42 RegisterClass(BillboardProjectile); 43 43 44 BillboardProjectile::BillboardProjectile( BaseObject* creator) : Projectile(creator)44 BillboardProjectile::BillboardProjectile(Context* context) : Projectile(context) 45 45 { 46 46 RegisterObject(BillboardProjectile); -
code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h
r8855 r9667 55 55 { 56 56 public: 57 BillboardProjectile( BaseObject* creator);57 BillboardProjectile(Context* context); 58 58 virtual ~BillboardProjectile(); 59 59 -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc
r8855 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(LightningGunProjectile);42 RegisterClass(LightningGunProjectile); 43 43 44 LightningGunProjectile::LightningGunProjectile( BaseObject* creator) : BillboardProjectile(creator)44 LightningGunProjectile::LightningGunProjectile(Context* context) : BillboardProjectile(context) 45 45 { 46 46 RegisterObject(LightningGunProjectile); -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h
r8855 r9667 55 55 { 56 56 public: 57 LightningGunProjectile( BaseObject* creator);57 LightningGunProjectile(Context* context); 58 58 virtual ~LightningGunProjectile() {} 59 59 -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc
r8855 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(ParticleProjectile);43 RegisterClass(ParticleProjectile); 44 44 45 ParticleProjectile::ParticleProjectile( BaseObject* creator) : BillboardProjectile(creator)45 ParticleProjectile::ParticleProjectile(Context* context) : BillboardProjectile(context) 46 46 { 47 47 RegisterObject(ParticleProjectile); … … 65 65 { 66 66 this->detachOgreObject(this->particles_->getParticleSystem()); 67 this->particles_->destroy();67 delete this->particles_; 68 68 } 69 69 } -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h
r8855 r9667 51 51 { 52 52 public: 53 ParticleProjectile( BaseObject* creator);53 ParticleProjectile(Context* context); 54 54 virtual ~ParticleProjectile(); 55 55 virtual void changedVisibility(); -
code/trunk/src/modules/weapons/projectiles/Projectile.cc
r8855 r9667 34 34 #include "Projectile.h" 35 35 36 #include "core/ ConfigValueIncludes.h"36 #include "core/config/ConfigValueIncludes.h" 37 37 #include "core/CoreIncludes.h" 38 38 #include "core/GameMode.h" … … 44 44 namespace orxonox 45 45 { 46 CreateFactory(Projectile);46 RegisterClass(Projectile); 47 47 48 Projectile::Projectile( BaseObject* creator) : MovableEntity(creator), BasicProjectile()48 Projectile::Projectile(Context* context) : MovableEntity(context), BasicProjectile() 49 49 { 50 50 RegisterObject(Projectile); … … 60 60 this->setCollisionType(Kinematic); 61 61 62 SphereCollisionShape* shape = new SphereCollisionShape(this );62 SphereCollisionShape* shape = new SphereCollisionShape(this->getContext()); 63 63 shape->setRadius(20.0f); 64 64 this->attachCollisionShape(shape); -
code/trunk/src/modules/weapons/projectiles/Projectile.h
r8855 r9667 58 58 { 59 59 public: 60 Projectile( BaseObject* creator);60 Projectile(Context* context); 61 61 virtual ~Projectile(); 62 62 -
code/trunk/src/modules/weapons/projectiles/Rocket.cc
r9016 r9667 51 51 namespace orxonox 52 52 { 53 CreateFactory(Rocket);53 RegisterClass(Rocket); 54 54 55 55 /** … … 57 57 Constructor. Registers the object and initializes some default values. 58 58 */ 59 Rocket::Rocket( BaseObject* creator)60 : ControllableEntity(c reator)59 Rocket::Rocket(Context* context) 60 : ControllableEntity(context) 61 61 , BasicProjectile() 62 , RadarViewable( creator, static_cast<WorldEntity*>(this))62 , RadarViewable(this, static_cast<WorldEntity*>(this)) 63 63 { 64 64 RegisterObject(Rocket);// Register the Rocket class to the core … … 73 73 74 74 // Create rocket model 75 Model* model = new Model(this );75 Model* model = new Model(this->getContext()); 76 76 model->setMeshSource("rocket.mesh"); 77 77 model->scale(0.7f); … … 79 79 80 80 // Add effects. 81 ParticleEmitter* fire = new ParticleEmitter(this );81 ParticleEmitter* fire = new ParticleEmitter(this->getContext()); 82 82 this->attach(fire); 83 83 fire->setOrientation(this->getOrientation()); … … 89 89 90 90 // Add collision shape 91 ConeCollisionShape* collisionShape = new ConeCollisionShape(this );91 ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext()); 92 92 collisionShape->setRadius(3); 93 93 collisionShape->setHeight(500); … … 97 97 98 98 // Add sound 99 this->defSndWpnEngine_ = new WorldSound(this );99 this->defSndWpnEngine_ = new WorldSound(this->getContext()); 100 100 this->defSndWpnEngine_->setLooping(true); 101 101 this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg"); … … 103 103 this->attach(defSndWpnEngine_); 104 104 105 this->defSndWpnLaunch_ = new WorldSound(this );105 this->defSndWpnLaunch_ = new WorldSound(this->getContext()); 106 106 this->defSndWpnLaunch_->setLooping(false); 107 107 this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg"); … … 116 116 117 117 // Add camera 118 CameraPosition* camPosition = new CameraPosition(this );118 CameraPosition* camPosition = new CameraPosition(this->getContext()); 119 119 camPosition->setPosition(0,4,15); 120 120 camPosition->setAllowMouseLook(true); … … 226 226 if(this->getShooter()) 227 227 { 228 effect1 = new ParticleSpawner(this->getShooter()->getC reator());229 effect2 = new ParticleSpawner(this->getShooter()->getC reator());228 effect1 = new ParticleSpawner(this->getShooter()->getContext()); 229 effect2 = new ParticleSpawner(this->getShooter()->getContext()); 230 230 } 231 231 else 232 232 { 233 effect1 = new ParticleSpawner( static_cast<BaseObject*>(this->getScene().get()));234 effect2 = new ParticleSpawner( static_cast<BaseObject*>(this->getScene().get()));233 effect1 = new ParticleSpawner(this->getContext()); 234 effect2 = new ParticleSpawner(this->getContext()); 235 235 } 236 236 -
code/trunk/src/modules/weapons/projectiles/Rocket.h
r9016 r9667 59 59 { 60 60 public: 61 Rocket( BaseObject* creator);61 Rocket(Context* context); 62 62 virtual ~Rocket(); 63 63 -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
r8859 r9667 52 52 namespace orxonox 53 53 { 54 CreateFactory(SimpleRocket);54 RegisterClass(SimpleRocket); 55 55 56 56 const float SimpleRocket::FUEL_PERCENTAGE = 0.8f; 57 57 58 SimpleRocket::SimpleRocket( BaseObject* creator)59 : ControllableEntity(c reator)58 SimpleRocket::SimpleRocket(Context* context) 59 : ControllableEntity(context) 60 60 , BasicProjectile() 61 , RadarViewable( creator, static_cast<WorldEntity*>(this))61 , RadarViewable(this, static_cast<WorldEntity*>(this)) 62 62 { 63 63 RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core … … 74 74 75 75 // Create rocket model. 76 Model* model = new Model(this );76 Model* model = new Model(this->getContext()); 77 77 model->setMeshSource("rocket.mesh"); 78 78 model->scale(0.7f); … … 80 80 81 81 // Add effects. 82 this->fire_ = new ParticleEmitter(this );82 this->fire_ = new ParticleEmitter(this->getContext()); 83 83 this->attach(this->fire_); 84 84 … … 91 91 // Add collision shape. 92 92 // TODO: fix the orientation and size of this collision shape to match the rocket 93 ConeCollisionShape* collisionShape = new ConeCollisionShape(this );93 ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext()); 94 94 collisionShape->setOrientation(this->getOrientation()); 95 95 collisionShape->setRadius(1.5f); -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
r8859 r9667 60 60 { 61 61 public: 62 SimpleRocket( BaseObject* creator);62 SimpleRocket(Context* context); 63 63 virtual ~SimpleRocket(); 64 64 virtual void tick(float dt); -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
r8855 r9667 49 49 namespace orxonox 50 50 { 51 CreateFactory(EnergyDrink);51 RegisterClass(EnergyDrink); 52 52 53 EnergyDrink::EnergyDrink( BaseObject* creator) : WeaponMode(creator)53 EnergyDrink::EnergyDrink(Context* context) : WeaponMode(context) 54 54 { 55 55 RegisterObject(EnergyDrink); … … 101 101 { 102 102 // Create the projectile 103 Projectile* projectile = new Projectile(this );104 Model* model = new Model(projectile );103 Projectile* projectile = new Projectile(this->getContext()); 104 Model* model = new Model(projectile->getContext()); 105 105 model->setMeshSource("can.mesh"); 106 106 model->setCastShadows(false); … … 127 127 void EnergyDrink::muzzleflash() 128 128 { 129 MuzzleFlash *muzzleFlash = new MuzzleFlash(this );129 MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext()); 130 130 this->getWeapon()->attach(muzzleFlash); 131 131 muzzleFlash->setPosition(this->getMuzzleOffset()); -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h
r8855 r9667 54 54 { 55 55 public: 56 EnergyDrink( BaseObject* creator);56 EnergyDrink(Context* context); 57 57 virtual ~EnergyDrink() {} 58 58 -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
r8855 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(FusionFire);48 RegisterClass(FusionFire); 49 49 50 FusionFire::FusionFire( BaseObject* creator) : WeaponMode(creator)50 FusionFire::FusionFire(Context* context) : WeaponMode(context) 51 51 { 52 52 RegisterObject(FusionFire); … … 66 66 void FusionFire::fire() 67 67 { 68 BillboardProjectile* projectile = new BillboardProjectile(this );68 BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 69 69 70 70 projectile->setOrientation(this->getMuzzleOrientation()); -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.h
r8855 r9667 51 51 { 52 52 public: 53 FusionFire( BaseObject* creator);53 FusionFire(Context* context); 54 54 virtual ~FusionFire() {} 55 55 -
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
r9526 r9667 50 50 namespace orxonox 51 51 { 52 CreateFactory(HsW01);52 RegisterClass(HsW01); 53 53 54 HsW01::HsW01( BaseObject* creator) : WeaponMode(creator)54 HsW01::HsW01(Context* context) : WeaponMode(context) 55 55 { 56 56 RegisterObject(HsW01); … … 111 111 112 112 // Create the projectile. 113 Projectile* projectile = new Projectile(this );114 Model* model = new Model(projectile );113 Projectile* projectile = new Projectile(this->getContext()); 114 Model* model = new Model(projectile->getContext()); 115 115 model->setMeshSource(mesh_); 116 116 model->setCastShadows(false); … … 138 138 void HsW01::muzzleflash() 139 139 { 140 MuzzleFlash *muzzleFlash = new MuzzleFlash(this );140 MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext()); 141 141 this->getWeapon()->attach(muzzleFlash); 142 142 muzzleFlash->setPosition(this->getMuzzleOffset()); -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r9526 r9667 53 53 { 54 54 public: 55 HsW01( BaseObject* creator);55 HsW01(Context* context); 56 56 virtual ~HsW01(); 57 57 -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
r8855 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(LaserFire);47 RegisterClass(LaserFire); 48 48 49 LaserFire::LaserFire( BaseObject* creator) : WeaponMode(creator)49 LaserFire::LaserFire(Context* context) : WeaponMode(context) 50 50 { 51 51 RegisterObject(LaserFire); … … 64 64 void LaserFire::fire() 65 65 { 66 ParticleProjectile* projectile = new ParticleProjectile(this );66 ParticleProjectile* projectile = new ParticleProjectile(this->getContext()); 67 67 68 68 projectile->setOrientation(this->getMuzzleOrientation()); -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.h
r8855 r9667 51 51 { 52 52 public: 53 LaserFire( BaseObject* creator);53 LaserFire(Context* context); 54 54 virtual ~LaserFire() {} 55 55 -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
r9016 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(LightningGun);46 RegisterClass(LightningGun); 47 47 48 LightningGun::LightningGun( BaseObject* creator) : WeaponMode(creator)48 LightningGun::LightningGun(Context* context) : WeaponMode(context) 49 49 { 50 50 RegisterObject(LightningGun); … … 68 68 void LightningGun::fire() 69 69 { 70 LightningGunProjectile* projectile = new LightningGunProjectile(this );70 LightningGunProjectile* projectile = new LightningGunProjectile(this->getContext()); 71 71 projectile->setMaterial("Flares/LightningBall_"); 72 72 -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.h
r8855 r9667 51 51 { 52 52 public: 53 LightningGun( BaseObject* creator);53 LightningGun(Context* context); 54 54 virtual ~LightningGun(); 55 55 -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
r8855 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(RocketFire);48 RegisterClass(RocketFire); 49 49 50 RocketFire::RocketFire( BaseObject* creator) : WeaponMode(creator)50 RocketFire::RocketFire(Context* context) : WeaponMode(context) 51 51 { 52 52 RegisterObject(RocketFire); … … 71 71 void RocketFire::fire() 72 72 { 73 Rocket* rocket = new Rocket(this );73 Rocket* rocket = new Rocket(this->getContext()); 74 74 75 75 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.h
r8855 r9667 51 51 { 52 52 public: 53 RocketFire( BaseObject* creator);53 RocketFire(Context* context); 54 54 virtual ~RocketFire(); 55 55 -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r8855 r9667 50 50 { 51 51 52 CreateFactory(SimpleRocketFire);52 RegisterClass(SimpleRocketFire); 53 53 54 SimpleRocketFire::SimpleRocketFire( BaseObject* creator) : WeaponMode(creator)54 SimpleRocketFire::SimpleRocketFire(Context* context) : WeaponMode(context) 55 55 { 56 56 RegisterObject(SimpleRocketFire); … … 76 76 void SimpleRocketFire::fire() 77 77 { 78 RocketController* controller = new RocketController(this );78 RocketController* controller = new RocketController(this->getContext()); 79 79 SimpleRocket* rocket = controller->getRocket(); 80 80 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h
r8855 r9667 50 50 { 51 51 public: 52 SimpleRocketFire( BaseObject* creator);52 SimpleRocketFire(Context* context); 53 53 virtual ~SimpleRocketFire(); 54 54 void deactivateFire(); -
code/trunk/src/orxonox/CameraManager.cc
r9348 r9667 38 38 #include "core/GameMode.h" 39 39 #include "core/GraphicsManager.h" 40 #include "core/ ObjectList.h"40 #include "core/object/ObjectList.h" 41 41 #include "tools/Shader.h" 42 42 #include "graphics/Camera.h" … … 48 48 CameraManager::CameraManager() 49 49 { 50 RegisterRootObject(CameraManager);51 52 50 assert(GameMode::showsGraphics()); 53 51 } -
code/trunk/src/orxonox/CameraManager.h
r8079 r9667 41 41 #include "util/OgreForwardRefs.h" 42 42 #include "util/Singleton.h" 43 #include "core/OrxonoxClass.h"44 43 45 44 namespace orxonox 46 45 { 47 class _OrxonoxExport CameraManager : public Singleton<CameraManager> , public OrxonoxClass46 class _OrxonoxExport CameraManager : public Singleton<CameraManager> 48 47 { 49 48 friend class Singleton<CameraManager>; -
code/trunk/src/orxonox/Level.cc
r9016 r9667 43 43 namespace orxonox 44 44 { 45 CreateFactory(Level);45 RegisterClass(Level); 46 46 47 Level::Level( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)47 Level::Level(Context* context) : BaseObject(context), Synchronisable(context), Context(context) 48 48 { 49 49 RegisterObject(Level); -
code/trunk/src/orxonox/Level.h
r9016 r9667 41 41 namespace orxonox 42 42 { 43 class _OrxonoxExport Level : public BaseObject, public Synchronisable 43 class _OrxonoxExport Level : public BaseObject, public Synchronisable, public Context 44 44 { 45 45 public: 46 Level( BaseObject* creator);46 Level(Context* context); 47 47 virtual ~Level(); 48 48 -
code/trunk/src/orxonox/LevelInfo.cc
r9348 r9667 242 242 // LevelInfo 243 243 244 CreateFactory(LevelInfo);244 RegisterClass(LevelInfo); 245 245 246 246 /** … … 250 250 The creator of this object. 251 251 */ 252 LevelInfo::LevelInfo( BaseObject* creator) : BaseObject(creator)252 LevelInfo::LevelInfo(Context* context) : BaseObject(context) 253 253 { 254 254 RegisterObject(LevelInfo); -
code/trunk/src/orxonox/LevelInfo.h
r9348 r9667 45 45 #include <iostream> 46 46 #include <fstream> 47 #include "core/ OrxonoxClass.h"47 #include "core/class/OrxonoxInterface.h" 48 48 49 49 namespace orxonox // tolua_export … … 61 61 */ 62 62 class _OrxonoxExport LevelInfoItem // tolua_export 63 : virtual public Orxonox Class63 : virtual public OrxonoxInterface 64 64 { // tolua_export 65 65 public: … … 204 204 { 205 205 public: 206 LevelInfo( BaseObject* creator);206 LevelInfo(Context* context); 207 207 virtual ~LevelInfo(); 208 208 -
code/trunk/src/orxonox/LevelManager.cc
r9550 r9667 37 37 38 38 #include "util/ScopedSingletonManager.h" 39 #include "core/config/CommandLineParser.h" 40 #include "core/config/ConfigValueIncludes.h" 41 #include "core/CoreIncludes.h" 39 42 #include "core/ClassTreeMask.h" 40 #include "core/CommandLineParser.h"41 #include "core/ConfigValueIncludes.h"42 #include "core/CoreIncludes.h"43 43 #include "core/Loader.h" 44 44 #include "core/Resource.h" … … 59 59 LevelManager::LevelManager() 60 60 { 61 Register RootObject(LevelManager);61 RegisterObject(LevelManager); 62 62 this->setConfigValues(); 63 63 -
code/trunk/src/orxonox/LevelManager.h
r8079 r9667 46 46 47 47 #include "util/Singleton.h" 48 #include "core/ OrxonoxClass.h"48 #include "core/config/Configurable.h" 49 49 50 50 // tolua_begin … … 67 67 class _OrxonoxExport LevelManager 68 68 // tolua_end 69 : public Singleton<LevelManager>, public OrxonoxClass69 : public Singleton<LevelManager>, public Configurable 70 70 { // tolua_export 71 71 friend class Singleton<LevelManager>; -
code/trunk/src/orxonox/Main.cc
r9550 r9667 36 36 #include "Main.h" 37 37 38 #include "core/ CommandLineParser.h"38 #include "core/config/CommandLineParser.h" 39 39 #include "core/Game.h" 40 40 #include "core/LuaState.h" -
code/trunk/src/orxonox/MoodManager.cc
r8858 r9667 30 30 31 31 #include "util/ScopedSingletonManager.h" 32 #include "core/ ConfigValueIncludes.h"32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/Resource.h" … … 43 43 MoodManager::MoodManager() 44 44 { 45 Register RootObject(MoodManager);45 RegisterObject(MoodManager); 46 46 this->setConfigValues(); 47 47 … … 95 95 MoodListener::MoodListener() 96 96 { 97 Register RootObject(MoodListener);97 RegisterObject(MoodListener); 98 98 } 99 99 -
code/trunk/src/orxonox/MoodManager.h
r8706 r9667 34 34 #include <string> 35 35 #include "util/Singleton.h" 36 #include "core/ OrxonoxClass.h"36 #include "core/class/OrxonoxInterface.h" 37 37 38 38 namespace orxonox … … 42 42 The MoodListener class is aware of a change in themes and directs that info to dependent classes. 43 43 */ 44 class _OrxonoxExport MoodListener : virtual public Orxonox Class44 class _OrxonoxExport MoodListener : virtual public OrxonoxInterface 45 45 { 46 46 friend class MoodManager; … … 60 60 The MoodManager class serves to allow for different musical themes in the game. 61 61 */ 62 class _OrxonoxExport MoodManager : public Singleton<MoodManager>, public OrxonoxClass62 class _OrxonoxExport MoodManager : public Singleton<MoodManager>, public Configurable 63 63 { 64 64 friend class Singleton<MoodManager>; … … 74 74 75 75 private: 76 ~MoodManager() {}77 76 void checkMoodValidity(); 78 77 -
code/trunk/src/orxonox/PawnManager.cc
r8351 r9667 39 39 PawnManager::PawnManager() 40 40 { 41 Register RootObject(PawnManager);41 RegisterObject(PawnManager); 42 42 } 43 43 -
code/trunk/src/orxonox/PlayerManager.cc
r8858 r9667 43 43 PlayerManager::PlayerManager() 44 44 { 45 Register RootObject(PlayerManager);45 RegisterObject(PlayerManager); 46 46 47 47 // this->getConnectedClients(); -
code/trunk/src/orxonox/Radar.cc
r8858 r9667 37 37 38 38 //#include "util/Math.h" 39 #include "core/ ObjectList.h"39 #include "core/object/ObjectList.h" 40 40 #include "core/command/ConsoleCommand.h" 41 41 #include "interfaces/RadarListener.h" -
code/trunk/src/orxonox/Radar.h
r7163 r9667 41 41 #include <string> 42 42 43 #include "core/ ObjectListIterator.h"43 #include "core/object/ObjectListIterator.h" 44 44 #include "interfaces/RadarViewable.h" 45 45 #include "tools/interfaces/Tickable.h" … … 74 74 void radarObjectChanged(RadarViewable* rv); 75 75 76 ObjectList Iterator<RadarViewable>itFocus_;76 ObjectList<RadarViewable>::iterator itFocus_; 77 77 RadarViewable* focus_; 78 78 std::map<std::string, RadarViewable::Shape> objectTypes_; -
code/trunk/src/orxonox/Scene.cc
r9348 r9667 51 51 namespace orxonox 52 52 { 53 CreateFactory(Scene);54 55 Scene::Scene( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)53 RegisterClass(Scene); 54 55 Scene::Scene(Context* context) : BaseObject(context), Synchronisable(context), Context(context) 56 56 { 57 57 RegisterObject(Scene); -
code/trunk/src/orxonox/Scene.h
r6417 r9667 45 45 namespace orxonox 46 46 { 47 class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable 47 class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable, public Context 48 48 { 49 49 public: 50 Scene( BaseObject* creator);50 Scene(Context* context); 51 51 virtual ~Scene(); 52 52 -
code/trunk/src/orxonox/Test.cc
r8858 r9667 28 28 29 29 #include "core/CoreIncludes.h" 30 #include "core/ ConfigValueIncludes.h"30 #include "core/config/ConfigValueIncludes.h" 31 31 #include "core/command/ConsoleCommand.h" 32 32 #include "network/NetworkFunction.h" … … 36 36 namespace orxonox 37 37 { 38 CreateFactory( Test );38 RegisterClass ( Test ); 39 39 40 40 SetConsoleCommand("Test", "printV1", &Test::printV1).addShortcut(); … … 56 56 Test* Test::instance_ = 0; 57 57 58 Test::Test( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)58 Test::Test(Context* context) : BaseObject(context), Synchronisable(context) 59 59 { 60 60 assert(instance_==0); -
code/trunk/src/orxonox/Test.h
r8858 r9667 46 46 { 47 47 public: 48 Test( BaseObject* creator);48 Test(Context* context); 49 49 virtual ~Test(); 50 50 -
code/trunk/src/orxonox/chat/ChatHistory.cc
r8858 r9667 39 39 /* constructor */ 40 40 #ifndef CHATTEST 41 //ChatHistory::ChatHistory( BaseObject* creator ) : BaseObject(creator)42 41 ChatHistory::ChatHistory() 43 42 #else -
code/trunk/src/orxonox/chat/ChatListener.h
r8858 r9667 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "core/ OrxonoxClass.h"34 #include "core/object/Listable.h" 35 35 36 36 namespace orxonox … … 40 40 message was sent through ChatManager. 41 41 */ 42 class _OrxonoxExport ChatListener : virtual public OrxonoxClass42 class _OrxonoxExport ChatListener : virtual public Listable 43 43 { 44 44 friend class ChatManager; -
code/trunk/src/orxonox/chat/ChatManager.cc
r8858 r9667 113 113 // ChatListener // 114 114 ////////////////////////////////////////////////////////////////////////// 115 RegisterAbstractClass(ChatListener).inheritsFrom(Class(Listable)); 115 116 116 117 ChatListener::ChatListener() 117 118 { 118 Register RootObject(ChatListener);119 RegisterObject(ChatListener); 119 120 } 120 121 } -
code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
r8858 r9667 44 44 namespace orxonox 45 45 { 46 RegisterAbstractClass(CollisionShape).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable)); 46 47 47 48 /** … … 49 50 Constructor. Registers and initializes the object. 50 51 */ 51 CollisionShape::CollisionShape( BaseObject* creator)52 : BaseObject(c reator)53 , Synchronisable(c reator)52 CollisionShape::CollisionShape(Context* context) 53 : BaseObject(context) 54 , Synchronisable(context) 54 55 { 55 56 RegisterObject(CollisionShape); -
code/trunk/src/orxonox/collisionshapes/CollisionShape.h
r8706 r9667 58 58 { 59 59 public: 60 CollisionShape( BaseObject* creator);60 CollisionShape(Context* context); 61 61 virtual ~CollisionShape(); 62 62 -
code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r8858 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(CompoundCollisionShape);44 RegisterClass(CompoundCollisionShape); 45 45 46 46 /** … … 48 48 Constructor. Registers and initializes the object. 49 49 */ 50 CompoundCollisionShape::CompoundCollisionShape( BaseObject* creator) : CollisionShape(creator)50 CompoundCollisionShape::CompoundCollisionShape(Context* context) : CollisionShape(context) 51 51 { 52 52 RegisterObject(CompoundCollisionShape); -
code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.h
r8706 r9667 58 58 { 59 59 public: 60 CompoundCollisionShape( BaseObject* creator);60 CompoundCollisionShape(Context* context); 61 61 virtual ~CompoundCollisionShape(); 62 62 -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
r8706 r9667 37 37 namespace orxonox 38 38 { 39 WorldEntityCollisionShape::WorldEntityCollisionShape( WorldEntity* creator) : CompoundCollisionShape(creator)39 WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context) 40 40 { 41 41 RegisterObject(WorldEntityCollisionShape); 42 42 43 this->worldEntityOwner_ = creator;43 this->worldEntityOwner_ = NULL; 44 44 // suppress synchronisation 45 45 this->setSyncMode(ObjectDirection::None); -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h
r5781 r9667 38 38 { 39 39 public: 40 WorldEntityCollisionShape( WorldEntity* creator);40 WorldEntityCollisionShape(Context* context); 41 41 virtual ~WorldEntityCollisionShape(); 42 42 43 inline WorldEntity* getWorldEntityOwner() 43 inline void setWorldEntityOwner(WorldEntity* worldEntityOwner) 44 { this->worldEntityOwner_ = worldEntityOwner; } 45 inline WorldEntity* getWorldEntityOwner() const 44 46 { return this->worldEntityOwner_; } 45 47 -
code/trunk/src/orxonox/controllers/AIController.cc
r9016 r9667 39 39 const float AIController::ACTION_INTERVAL = 1.0f; 40 40 41 CreateFactory(AIController);42 43 AIController::AIController( BaseObject* creator) : ArtificialController(creator)41 RegisterClass(AIController); 42 43 AIController::AIController(Context* context) : ArtificialController(context) 44 44 { 45 45 RegisterObject(AIController); -
code/trunk/src/orxonox/controllers/AIController.h
r9016 r9667 41 41 { 42 42 public: 43 AIController( BaseObject* creator);43 AIController(Context* context); 44 44 virtual ~AIController(); 45 45 -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r9252 r9667 45 45 SetConsoleCommand("ArtificialController", "setbotlevel", &ArtificialController::setAllBotLevel); 46 46 47 ArtificialController::ArtificialController(BaseObject* creator) : FormationController(creator) 47 RegisterClass(ArtificialController); 48 49 ArtificialController::ArtificialController(Context* context) : FormationController(context) 48 50 { 49 51 RegisterObject(ArtificialController); -
code/trunk/src/orxonox/controllers/ArtificialController.h
r9252 r9667 39 39 { 40 40 public: 41 ArtificialController( BaseObject* creator);41 ArtificialController(Context* context); 42 42 virtual ~ArtificialController(); 43 43 -
code/trunk/src/orxonox/controllers/Controller.cc
r6417 r9667 33 33 namespace orxonox 34 34 { 35 CreateUnloadableFactory(Controller);35 RegisterUnloadableClass(Controller); 36 36 37 Controller::Controller( BaseObject* creator) : BaseObject(creator)37 Controller::Controller(Context* context) : BaseObject(context) 38 38 { 39 39 RegisterObject(Controller); -
code/trunk/src/orxonox/controllers/Controller.h
r9666 r9667 42 42 43 43 public: 44 Controller( BaseObject* creator);44 Controller(Context* context); 45 45 virtual ~Controller(); 46 46 -
code/trunk/src/orxonox/controllers/DroneController.cc
r8891 r9667 41 41 Constructor. 42 42 */ 43 CreateFactory(DroneController);43 RegisterClass(DroneController); 44 44 45 45 const float DroneController::ACTION_INTERVAL = 1.0f; 46 46 47 DroneController::DroneController( BaseObject* creator) : ArtificialController(creator)47 DroneController::DroneController(Context* context) : ArtificialController(context) 48 48 { 49 49 RegisterObject(DroneController); -
code/trunk/src/orxonox/controllers/DroneController.h
r8891 r9667 33 33 34 34 #include "AIController.h" 35 #include "core/ WeakPtr.h"35 #include "core/object/WeakPtr.h" 36 36 #include "tools/interfaces/Tickable.h" 37 37 … … 50 50 { 51 51 public: 52 DroneController( BaseObject* creator);52 DroneController(Context* context); 53 53 virtual ~DroneController(); 54 54 -
code/trunk/src/orxonox/controllers/FormationController.cc
r9663 r9667 56 56 SetConsoleCommand("FormationController", "formationsize", &FormationController::formationsize); 57 57 58 59 58 RegisterClass(FormationController); 60 59 61 60 static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9; … … 69 68 static const float ROTATEFACTOR_FREE = 0.8f; 70 69 71 FormationController::FormationController( BaseObject* creator) : Controller(creator)70 FormationController::FormationController(Context* context) : Controller(context) 72 71 { 73 72 RegisterObject(FormationController); -
code/trunk/src/orxonox/controllers/FormationController.h
r9625 r9667 33 33 34 34 #include <vector> 35 #include "core/ Super.h"35 #include "core/class/Super.h" 36 36 37 37 #include "util/Math.h" 38 #include "core/OrxonoxClass.h"39 38 #include "controllers/Controller.h" 40 39 #include "worldentities/ControllableEntity.h" … … 47 46 48 47 public: 49 FormationController( BaseObject* creator);48 FormationController(Context* context); 50 49 51 50 virtual ~FormationController(); -
code/trunk/src/orxonox/controllers/HumanController.cc
r9625 r9667 66 66 SetConsoleCommand("HumanController", "myposition", &HumanController::myposition ).addShortcut(); 67 67 68 CreateUnloadableFactory(HumanController);68 RegisterUnloadableClass(HumanController); 69 69 70 70 HumanController* HumanController::localController_s = 0; 71 71 /*static*/ const float HumanController::BOOSTING_TIME = 0.1f; 72 72 73 HumanController::HumanController( BaseObject* creator) : FormationController(creator)73 HumanController::HumanController(Context* context) : FormationController(context) 74 74 { 75 75 RegisterObject(HumanController); -
code/trunk/src/orxonox/controllers/HumanController.h
r9256 r9667 44 44 { // tolua_export 45 45 public: 46 HumanController( BaseObject* creator);46 HumanController(Context* context); 47 47 virtual ~HumanController(); 48 48 -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r9348 r9667 56 56 SetConsoleCommand("NewHumanController", "unfire", &NewHumanController::unfire ).keybindMode(KeybindMode::OnRelease).addShortcut(); 57 57 58 CreateUnloadableFactory(NewHumanController);58 RegisterUnloadableClass(NewHumanController); 59 59 60 60 NewHumanController* NewHumanController::localController_s = 0; 61 61 62 NewHumanController::NewHumanController( BaseObject* creator)63 : HumanController(c reator)62 NewHumanController::NewHumanController(Context* context) 63 : HumanController(context) 64 64 , crossHairOverlay_(NULL) 65 65 , centerOverlay_(NULL) … … 98 98 if (GameMode::showsGraphics()) 99 99 { 100 crossHairOverlay_ = new OrxonoxOverlay(this );100 crossHairOverlay_ = new OrxonoxOverlay(this->getContext()); 101 101 crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3"); 102 102 crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_)); … … 104 104 //crossHairOverlay_->setAspectCorrection(true); not working 105 105 106 centerOverlay_ = new OrxonoxOverlay(this );106 centerOverlay_ = new OrxonoxOverlay(this->getContext()); 107 107 centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay"); 108 108 centerOverlay_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); … … 112 112 if (showDamageOverlay_) 113 113 { 114 damageOverlayTop_ = new OrxonoxOverlay(this );114 damageOverlayTop_ = new OrxonoxOverlay(this->getContext()); 115 115 damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop"); 116 116 damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); … … 118 118 damageOverlayTop_->hide(); 119 119 120 damageOverlayRight_ = new OrxonoxOverlay(this );120 damageOverlayRight_ = new OrxonoxOverlay(this->getContext()); 121 121 damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight"); 122 122 damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); … … 124 124 damageOverlayRight_->hide(); 125 125 126 damageOverlayBottom_ = new OrxonoxOverlay(this );126 damageOverlayBottom_ = new OrxonoxOverlay(this->getContext()); 127 127 damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom"); 128 128 damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); … … 130 130 damageOverlayBottom_->hide(); 131 131 132 damageOverlayLeft_ = new OrxonoxOverlay(this );132 damageOverlayLeft_ = new OrxonoxOverlay(this->getContext()); 133 133 damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft"); 134 134 damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f)); … … 139 139 if (showArrows_) 140 140 { 141 arrowsOverlay1_ = new OrxonoxOverlay(this );141 arrowsOverlay1_ = new OrxonoxOverlay(this->getContext()); 142 142 arrowsOverlay1_->setBackgroundMaterial("Orxonox/DirectionArrows1"); 143 143 arrowsOverlay1_->setSize(Vector2(0.02727f, 0.36f * arrowsSize_)); … … 146 146 arrowsOverlay1_->hide(); 147 147 148 arrowsOverlay2_ = new OrxonoxOverlay(this );148 arrowsOverlay2_ = new OrxonoxOverlay(this->getContext()); 149 149 arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2"); 150 150 arrowsOverlay2_->setSize(Vector2(0.02727f, 0.59f * arrowsSize_)); … … 153 153 arrowsOverlay2_->hide(); 154 154 155 arrowsOverlay3_ = new OrxonoxOverlay(this );155 arrowsOverlay3_ = new OrxonoxOverlay(this->getContext()); 156 156 arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3"); 157 157 arrowsOverlay3_->setSize(Vector2(0.02727f, 0.77f * arrowsSize_)); … … 160 160 arrowsOverlay3_->hide(); 161 161 162 arrowsOverlay4_ = new OrxonoxOverlay(this );162 arrowsOverlay4_ = new OrxonoxOverlay(this->getContext()); 163 163 arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4"); 164 164 arrowsOverlay4_->setSize(Vector2(0.02727f, arrowsSize_)); -
code/trunk/src/orxonox/controllers/NewHumanController.h
r9016 r9667 42 42 { 43 43 public: 44 NewHumanController( BaseObject* creator);44 NewHumanController(Context* context); 45 45 virtual ~NewHumanController(); 46 46 -
code/trunk/src/orxonox/controllers/ScriptController.cc
r5781 r9667 32 32 namespace orxonox 33 33 { 34 CreateFactory(ScriptController);34 RegisterClass(ScriptController); 35 35 36 ScriptController::ScriptController( BaseObject* creator) : ArtificialController(creator)36 ScriptController::ScriptController(Context* context) : ArtificialController(context) 37 37 { 38 38 RegisterObject(ScriptController); -
code/trunk/src/orxonox/controllers/ScriptController.h
r5781 r9667 38 38 { 39 39 public: 40 ScriptController( BaseObject* creator);40 ScriptController(Context* context); 41 41 virtual ~ScriptController() { } 42 42 -
code/trunk/src/orxonox/controllers/WaypointController.cc
r9252 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(WaypointController);36 RegisterClass(WaypointController); 37 37 38 WaypointController::WaypointController( BaseObject* creator) : ArtificialController(creator)38 WaypointController::WaypointController(Context* context) : ArtificialController(context) 39 39 { 40 40 RegisterObject(WaypointController); -
code/trunk/src/orxonox/controllers/WaypointController.h
r9252 r9667 41 41 { 42 42 public: 43 WaypointController( BaseObject* creator);43 WaypointController(Context* context); 44 44 virtual ~WaypointController(); 45 45 -
code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
r9016 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(WaypointPatrolController);38 RegisterClass(WaypointPatrolController); 39 39 40 WaypointPatrolController::WaypointPatrolController( BaseObject* creator) : WaypointController(creator)40 WaypointPatrolController::WaypointPatrolController(Context* context) : WaypointController(context) 41 41 { 42 42 RegisterObject(WaypointPatrolController); -
code/trunk/src/orxonox/controllers/WaypointPatrolController.h
r9016 r9667 40 40 { 41 41 public: 42 WaypointPatrolController( BaseObject* creator);42 WaypointPatrolController(Context* context); 43 43 virtual ~WaypointPatrolController() {} 44 44 -
code/trunk/src/orxonox/gamestates/GSClient.cc
r8858 r9667 30 30 31 31 #include "util/Exception.h" 32 #include "core/ CommandLineParser.h"32 #include "core/config/CommandLineParser.h" 33 33 #include "core/Game.h" 34 34 #include "core/GameMode.h" -
code/trunk/src/orxonox/gamestates/GSLevel.h
r7876 r9667 34 34 #include <string> 35 35 #include <set> 36 #include "core/OrxonoxClass.h"37 36 #include "core/GameState.h" 38 37 -
code/trunk/src/orxonox/gamestates/GSMainMenu.cc
r8858 r9667 31 31 #include <OgreSceneManager.h> 32 32 33 #include "core/ ConfigValueIncludes.h"33 #include "core/config/ConfigValueIncludes.h" 34 34 #include "core/CoreIncludes.h" 35 35 #include "core/Game.h" … … 66 66 : GameState(info) 67 67 { 68 Register RootObject(GSMainMenu);68 RegisterObject(GSMainMenu); 69 69 70 70 InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); -
code/trunk/src/orxonox/gamestates/GSMainMenu.h
r8079 r9667 34 34 #include "util/OgreForwardRefs.h" 35 35 #include "core/GameState.h" 36 #include "core/ OrxonoxClass.h"36 #include "core/config/Configurable.h" 37 37 38 38 namespace orxonox 39 39 { 40 class _OrxonoxExport GSMainMenu : public GameState, public OrxonoxClass40 class _OrxonoxExport GSMainMenu : public GameState, public Configurable 41 41 { 42 42 public: -
code/trunk/src/orxonox/gamestates/GSServer.cc
r8858 r9667 30 30 31 31 #include "util/Output.h" 32 #include "core/ CommandLineParser.h"32 #include "core/config/CommandLineParser.h" 33 33 #include "core/Game.h" 34 34 #include "core/GameMode.h" -
code/trunk/src/orxonox/gametypes/Asteroids.cc
r8858 r9667 35 35 namespace orxonox 36 36 { 37 CreateUnloadableFactory(Asteroids);37 RegisterUnloadableClass(Asteroids); 38 38 39 Asteroids::Asteroids( BaseObject* creator) : Gametype(creator)39 Asteroids::Asteroids(Context* context) : Gametype(context) 40 40 { 41 41 RegisterObject(Asteroids); -
code/trunk/src/orxonox/gametypes/Asteroids.h
r5781 r9667 38 38 { 39 39 public: 40 Asteroids( BaseObject* creator);40 Asteroids(Context* context); 41 41 virtual ~Asteroids() {} 42 42 -
code/trunk/src/orxonox/gametypes/Deathmatch.cc
r9348 r9667 36 36 namespace orxonox 37 37 { 38 CreateUnloadableFactory(Deathmatch);38 RegisterUnloadableClass(Deathmatch); 39 39 40 Deathmatch::Deathmatch( BaseObject* creator) : Gametype(creator)40 Deathmatch::Deathmatch(Context* context) : Gametype(context) 41 41 { 42 42 RegisterObject(Deathmatch); -
code/trunk/src/orxonox/gametypes/Deathmatch.h
r9348 r9667 38 38 { 39 39 public: 40 Deathmatch( BaseObject* creator);40 Deathmatch(Context* context); 41 41 virtual ~Deathmatch() {} 42 42 -
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
r9348 r9667 54 54 #include "worldentities/pawns/Pawn.h" 55 55 #include "worldentities/pawns/SpaceShip.h" 56 #include "core/ ConfigValueIncludes.h"56 #include "core/config/ConfigValueIncludes.h" 57 57 #include "interfaces/TeamColourable.h" 58 58 #include "items/Engine.h" … … 62 62 namespace orxonox 63 63 { 64 CreateUnloadableFactory(Dynamicmatch);65 66 Dynamicmatch::Dynamicmatch( BaseObject* creator) : Gametype(creator)64 RegisterUnloadableClass(Dynamicmatch); 65 66 Dynamicmatch::Dynamicmatch(Context* context) : Gametype(context) 67 67 { 68 68 RegisterObject(Dynamicmatch); -
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
r9348 r9667 44 44 { 45 45 public: 46 Dynamicmatch( BaseObject* creator);46 Dynamicmatch(Context* context); 47 47 virtual ~Dynamicmatch() {} 48 48 -
code/trunk/src/orxonox/gametypes/Gametype.cc
r9348 r9667 32 32 #include "core/Core.h" 33 33 #include "core/CoreIncludes.h" 34 #include "core/ ConfigValueIncludes.h"34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/GameMode.h" 36 36 #include "core/command/ConsoleCommand.h" … … 47 47 namespace orxonox 48 48 { 49 CreateUnloadableFactory(Gametype);50 51 Gametype::Gametype( BaseObject* creator) : BaseObject(creator)49 RegisterUnloadableClass(Gametype); 50 51 Gametype::Gametype(Context* context) : BaseObject(context) 52 52 { 53 53 RegisterObject(Gametype); 54 54 55 this->gtinfo_ = new GametypeInfo(c reator);55 this->gtinfo_ = new GametypeInfo(context); 56 56 57 57 this->setGametype(SmartPtr<Gametype>(this, false)); … … 74 74 if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty()) 75 75 { 76 this->scoreboard_ = new OverlayGroup( this);76 this->scoreboard_ = new OverlayGroup(context); 77 77 this->scoreboard_->addTemplate(this->scoreboardTemplate_); 78 78 this->scoreboard_->setGametype(this); … … 160 160 ControllableEntity* oldentity = it->first->getControllableEntity(); 161 161 162 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity );162 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity->getContext()); 163 163 if (oldentity->getCamera()) 164 164 { … … 283 283 this->gtinfo_->pawnKilled(victim->getPlayer()); 284 284 285 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getC reator());285 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getContext()); 286 286 if (victim->getCamera()) 287 287 { … … 458 458 { 459 459 // force spawn at spawnpoint with default pawn 460 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn );460 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn->getContext()); 461 461 spawn->spawn(entity); 462 462 player->startControl(entity); … … 472 472 { 473 473 for (unsigned int i = 0; i < amount; ++i) 474 this->botclass_.fabricate(this );474 this->botclass_.fabricate(this->getContext()); 475 475 } 476 476 -
code/trunk/src/orxonox/gametypes/Gametype.h
r9348 r9667 37 37 38 38 #include "core/BaseObject.h" 39 #include "core/ SubclassIdentifier.h"39 #include "core/class/SubclassIdentifier.h" 40 40 #include "tools/interfaces/Tickable.h" 41 41 #include "infos/GametypeInfo.h" … … 67 67 68 68 public: 69 Gametype( BaseObject* creator);69 Gametype(Context* context); 70 70 virtual ~Gametype(); 71 71 -
code/trunk/src/orxonox/gametypes/LastManStanding.cc
r9348 r9667 33 33 #include "infos/PlayerInfo.h" 34 34 #include "worldentities/pawns/Pawn.h" 35 #include "core/ ConfigValueIncludes.h"35 #include "core/config/ConfigValueIncludes.h" 36 36 #include "util/Convert.h" 37 37 38 38 namespace orxonox 39 39 { 40 CreateUnloadableFactory(LastManStanding);41 42 LastManStanding::LastManStanding( BaseObject* creator) : Deathmatch(creator)40 RegisterUnloadableClass(LastManStanding); 41 42 LastManStanding::LastManStanding(Context* context) : Deathmatch(context) 43 43 { 44 44 RegisterObject(LastManStanding); -
code/trunk/src/orxonox/gametypes/LastManStanding.h
r7655 r9667 65 65 66 66 public: 67 LastManStanding( BaseObject* creator); //!< Default Constructor.67 LastManStanding(Context* context); //!< Default Constructor. 68 68 virtual ~LastManStanding() {} //!< Default Destructor. 69 69 void setConfigValues(); //!< Makes values configurable. -
code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
r9348 r9667 33 33 #include "infos/PlayerInfo.h" 34 34 #include "worldentities/pawns/Pawn.h" 35 #include "core/ ConfigValueIncludes.h"35 #include "core/config/ConfigValueIncludes.h" 36 36 #include "util/Convert.h" 37 37 38 38 namespace orxonox 39 39 { 40 CreateUnloadableFactory(LastTeamStanding);41 42 LastTeamStanding::LastTeamStanding( BaseObject* creator) : TeamDeathmatch(creator)40 RegisterUnloadableClass(LastTeamStanding); 41 42 LastTeamStanding::LastTeamStanding(Context* context) : TeamDeathmatch(context) 43 43 { 44 44 RegisterObject(LastTeamStanding); -
code/trunk/src/orxonox/gametypes/LastTeamStanding.h
r8351 r9667 71 71 72 72 public: 73 LastTeamStanding( BaseObject* creator); //!< Default Constructor.73 LastTeamStanding(Context* context); //!< Default Constructor. 74 74 virtual ~LastTeamStanding(); //!< Default Destructor. 75 75 -
code/trunk/src/orxonox/gametypes/Mission.cc
r9348 r9667 37 37 namespace orxonox 38 38 { 39 CreateUnloadableFactory(Mission);39 RegisterUnloadableClass(Mission); 40 40 41 Mission::Mission( BaseObject* creator) : TeamGametype(creator)41 Mission::Mission(Context* context) : TeamGametype(context) 42 42 { 43 43 RegisterObject(Mission); -
code/trunk/src/orxonox/gametypes/Mission.h
r9348 r9667 39 39 { 40 40 public: 41 Mission( BaseObject* creator);41 Mission(Context* context); 42 42 virtual ~Mission() {} 43 43 -
code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
r9348 r9667 36 36 namespace orxonox 37 37 { 38 CreateUnloadableFactory(TeamBaseMatch);39 40 TeamBaseMatch::TeamBaseMatch( BaseObject* creator) : TeamDeathmatch(creator)38 RegisterUnloadableClass(TeamBaseMatch); 39 40 TeamBaseMatch::TeamBaseMatch(Context* context) : TeamDeathmatch(context) 41 41 { 42 42 RegisterObject(TeamBaseMatch); -
code/trunk/src/orxonox/gametypes/TeamBaseMatch.h
r9348 r9667 41 41 { 42 42 public: 43 TeamBaseMatch( BaseObject* creator);43 TeamBaseMatch(Context* context); 44 44 virtual ~TeamBaseMatch() {} 45 45 -
code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc
r9348 r9667 36 36 namespace orxonox 37 37 { 38 CreateUnloadableFactory(TeamDeathmatch);38 RegisterUnloadableClass(TeamDeathmatch); 39 39 40 TeamDeathmatch::TeamDeathmatch( BaseObject* creator) : TeamGametype(creator)40 TeamDeathmatch::TeamDeathmatch(Context* context) : TeamGametype(context) 41 41 { 42 42 RegisterObject(TeamDeathmatch); -
code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
r9348 r9667 38 38 { 39 39 public: 40 TeamDeathmatch( BaseObject* creator);40 TeamDeathmatch(Context* context); 41 41 virtual ~TeamDeathmatch() {} 42 42 -
code/trunk/src/orxonox/gametypes/TeamGametype.cc
r9348 r9667 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/ ConfigValueIncludes.h"32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "infos/PlayerInfo.h" 34 34 #include "interfaces/TeamColourable.h" … … 40 40 namespace orxonox 41 41 { 42 CreateUnloadableFactory(TeamGametype);43 44 TeamGametype::TeamGametype( BaseObject* creator) : Gametype(creator)42 RegisterUnloadableClass(TeamGametype); 43 44 TeamGametype::TeamGametype(Context* context) : Gametype(context) 45 45 { 46 46 RegisterObject(TeamGametype); -
code/trunk/src/orxonox/gametypes/TeamGametype.h
r9348 r9667 41 41 { 42 42 public: 43 TeamGametype( BaseObject* creator);43 TeamGametype(Context* context); 44 44 virtual ~TeamGametype() {} 45 45 -
code/trunk/src/orxonox/gametypes/UnderAttack.cc
r9348 r9667 31 31 #include "util/Convert.h" 32 32 #include "core/CoreIncludes.h" 33 #include "core/ ConfigValueIncludes.h"33 #include "core/config/ConfigValueIncludes.h" 34 34 #include "chat/ChatManager.h" 35 35 #include "worldentities/pawns/Destroyer.h" … … 38 38 namespace orxonox 39 39 { 40 CreateUnloadableFactory(UnderAttack);40 RegisterUnloadableClass(UnderAttack); 41 41 42 UnderAttack::UnderAttack( BaseObject* creator) : TeamDeathmatch(creator)42 UnderAttack::UnderAttack(Context* context) : TeamDeathmatch(context) 43 43 { 44 44 RegisterObject(UnderAttack); -
code/trunk/src/orxonox/gametypes/UnderAttack.h
r5929 r9667 39 39 { 40 40 public: 41 UnderAttack( BaseObject* creator);41 UnderAttack(Context* context); 42 42 virtual ~UnderAttack() {} 43 43 -
code/trunk/src/orxonox/graphics/AnimatedModel.cc
r8858 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(AnimatedModel);41 RegisterClass(AnimatedModel); 42 42 43 AnimatedModel::AnimatedModel( BaseObject* creator) : Model(creator)43 AnimatedModel::AnimatedModel(Context* context) : Model(context) 44 44 { 45 45 RegisterObject(AnimatedModel); -
code/trunk/src/orxonox/graphics/AnimatedModel.h
r8858 r9667 41 41 { 42 42 public: 43 AnimatedModel( BaseObject* creator);43 AnimatedModel(Context* context); 44 44 virtual ~AnimatedModel(); 45 45 -
code/trunk/src/orxonox/graphics/Backlight.cc
r8424 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(Backlight);48 49 Backlight::Backlight( BaseObject* creator) : FadingBillboard(creator)47 RegisterClass(Backlight); 48 49 Backlight::Backlight(Context* context) : FadingBillboard(context) 50 50 { 51 51 RegisterObject(Backlight); -
code/trunk/src/orxonox/graphics/Backlight.h
r7163 r9667 41 41 { 42 42 public: 43 Backlight( BaseObject* creator);43 Backlight(Context* context); 44 44 virtual ~Backlight(); 45 45 -
code/trunk/src/orxonox/graphics/Billboard.cc
r8706 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(Billboard);40 RegisterClass(Billboard); 41 41 42 Billboard::Billboard( BaseObject* creator) : StaticEntity(creator)42 Billboard::Billboard(Context* context) : StaticEntity(context) 43 43 { 44 44 RegisterObject(Billboard); -
code/trunk/src/orxonox/graphics/Billboard.h
r8706 r9667 44 44 { 45 45 public: 46 Billboard( BaseObject* creator);46 Billboard(Context* context); 47 47 virtual ~Billboard(); 48 48 -
code/trunk/src/orxonox/graphics/BlinkingBillboard.cc
r8351 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(BlinkingBillboard);37 RegisterClass(BlinkingBillboard); 38 38 39 BlinkingBillboard::BlinkingBillboard( BaseObject* creator) : Billboard(creator)39 BlinkingBillboard::BlinkingBillboard(Context* context) : Billboard(context) 40 40 { 41 41 RegisterObject(BlinkingBillboard); -
code/trunk/src/orxonox/graphics/BlinkingBillboard.h
r8351 r9667 41 41 { 42 42 public: 43 BlinkingBillboard( BaseObject* creator);43 BlinkingBillboard(Context* context); 44 44 virtual ~BlinkingBillboard(); 45 45 -
code/trunk/src/orxonox/graphics/Camera.cc
r8706 r9667 37 37 #include "util/StringUtils.h" 38 38 #include "core/CoreIncludes.h" 39 #include "core/ ConfigValueIncludes.h"39 #include "core/config/ConfigValueIncludes.h" 40 40 #include "core/GameMode.h" 41 41 #include "core/GUIManager.h" … … 46 46 namespace orxonox 47 47 { 48 CreateFactory(Camera);49 50 Camera::Camera( BaseObject* creator) : StaticEntity(creator)48 RegisterClass(Camera); 49 50 Camera::Camera(Context* context) : StaticEntity(context) 51 51 { 52 52 RegisterObject(Camera); -
code/trunk/src/orxonox/graphics/Camera.h
r8706 r9667 46 46 47 47 public: 48 Camera( BaseObject* creator);48 Camera(Context* context); 49 49 virtual ~Camera(); 50 50 -
code/trunk/src/orxonox/graphics/FadingBillboard.cc
r5929 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(FadingBillboard);36 RegisterClass(FadingBillboard); 37 37 38 FadingBillboard::FadingBillboard( BaseObject* creator) : Billboard(creator)38 FadingBillboard::FadingBillboard(Context* context) : Billboard(context) 39 39 { 40 40 RegisterObject(FadingBillboard); -
code/trunk/src/orxonox/graphics/FadingBillboard.h
r7163 r9667 42 42 { 43 43 public: 44 FadingBillboard( BaseObject* creator);44 FadingBillboard(Context* context); 45 45 virtual ~FadingBillboard(); 46 46 -
code/trunk/src/orxonox/graphics/GlobalShader.cc
r8079 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(GlobalShader);38 RegisterClass(GlobalShader); 39 39 40 GlobalShader::GlobalShader( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)40 GlobalShader::GlobalShader(Context* context) : BaseObject(context), Synchronisable(context) 41 41 { 42 42 RegisterObject(GlobalShader); -
code/trunk/src/orxonox/graphics/GlobalShader.h
r8079 r9667 41 41 { 42 42 public: 43 GlobalShader( BaseObject* creator);43 GlobalShader(Context* context); 44 44 virtual ~GlobalShader(); 45 45 -
code/trunk/src/orxonox/graphics/Light.cc
r5781 r9667 42 42 namespace orxonox 43 43 { 44 CreateFactory(Light);44 RegisterClass(Light); 45 45 46 46 // Be sure we don't do bad conversions … … 49 49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Spotlight); 50 50 51 Light::Light( BaseObject* creator) : StaticEntity(creator)51 Light::Light(Context* context) : StaticEntity(context) 52 52 { 53 53 RegisterObject(Light); -
code/trunk/src/orxonox/graphics/Light.h
r7401 r9667 53 53 54 54 public: 55 Light( BaseObject* creator);55 Light(Context* context); 56 56 virtual ~Light(); 57 57 -
code/trunk/src/orxonox/graphics/MeshLodInformation.cc
r7183 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(MeshLodInformation);40 RegisterClass(MeshLodInformation); 41 41 42 MeshLodInformation::MeshLodInformation( BaseObject* creator)43 : BaseObject(c reator), lodLevel_(5), bEnabled_(true), numLevels_(10), reductionRate_(0.15f)42 MeshLodInformation::MeshLodInformation(Context* context) 43 : BaseObject(context), lodLevel_(5), bEnabled_(true), numLevels_(10), reductionRate_(0.15f) 44 44 { 45 45 RegisterObject(MeshLodInformation); -
code/trunk/src/orxonox/graphics/MeshLodInformation.h
r7163 r9667 41 41 { 42 42 public: 43 MeshLodInformation( BaseObject* creator);43 MeshLodInformation(Context* context); 44 44 virtual ~MeshLodInformation(); 45 45 -
code/trunk/src/orxonox/graphics/Model.cc
r8858 r9667 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "core/ ConfigValueIncludes.h"34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/GameMode.h" 36 36 #include "core/XMLPort.h" … … 41 41 namespace orxonox 42 42 { 43 CreateFactory(Model);44 45 Model::Model( BaseObject* creator) :46 StaticEntity(c reator), bCastShadows_(true), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15f)43 RegisterClass(Model); 44 45 Model::Model(Context* context) : 46 StaticEntity(context), bCastShadows_(true), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15f) 47 47 { 48 48 RegisterObject(Model); -
code/trunk/src/orxonox/graphics/Model.h
r7166 r9667 41 41 { 42 42 public: 43 Model( BaseObject* creator);43 Model(Context* context); 44 44 virtual ~Model(); 45 45 -
code/trunk/src/orxonox/graphics/ParticleEmitter.cc
r9550 r9667 43 43 namespace orxonox 44 44 { 45 CreateFactory(ParticleEmitter);45 RegisterClass(ParticleEmitter); 46 46 47 ParticleEmitter::ParticleEmitter( BaseObject* creator) : StaticEntity(creator)47 ParticleEmitter::ParticleEmitter(Context* context) : StaticEntity(context) 48 48 { 49 49 RegisterObject(ParticleEmitter); … … 63 63 { 64 64 this->detachOgreObject(this->particles_->getParticleSystem()); 65 this->particles_->destroy();65 delete this->particles_; 66 66 } 67 67 } … … 101 101 if (this->particles_) 102 102 { 103 this->particles_->destroy();103 delete this->particles_; 104 104 this->particles_ = 0; 105 105 } -
code/trunk/src/orxonox/graphics/ParticleEmitter.h
r7904 r9667 40 40 { 41 41 public: 42 ParticleEmitter( BaseObject* creator);42 ParticleEmitter(Context* context); 43 43 virtual ~ParticleEmitter(); 44 44 -
code/trunk/src/orxonox/graphics/ParticleSpawner.cc
r7284 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(ParticleSpawner);39 RegisterClass(ParticleSpawner); 40 40 41 ParticleSpawner::ParticleSpawner( BaseObject* creator) : ParticleEmitter(creator)41 ParticleSpawner::ParticleSpawner(Context* context) : ParticleEmitter(context) 42 42 { 43 43 RegisterObject(ParticleSpawner); -
code/trunk/src/orxonox/graphics/ParticleSpawner.h
r5929 r9667 40 40 { 41 41 public: 42 ParticleSpawner( BaseObject* creator);42 ParticleSpawner(Context* context); 43 43 virtual ~ParticleSpawner(); 44 44 -
code/trunk/src/orxonox/infos/Bot.cc
r7801 r9667 32 32 #include "core/GameMode.h" 33 33 #include "core/CoreIncludes.h" 34 #include "core/ ConfigValueIncludes.h"34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "gametypes/Gametype.h" 36 36 #include "controllers/AIController.h" … … 38 38 namespace orxonox 39 39 { 40 CreateFactory(Bot);40 RegisterClass(Bot); 41 41 42 Bot::Bot( BaseObject* creator) : PlayerInfo(creator)42 Bot::Bot(Context* context) : PlayerInfo(context) 43 43 { 44 44 RegisterObject(Bot); -
code/trunk/src/orxonox/infos/Bot.h
r5781 r9667 40 40 { 41 41 public: 42 Bot( BaseObject* creator);42 Bot(Context* context); 43 43 virtual ~Bot(); 44 44 -
code/trunk/src/orxonox/infos/GametypeInfo.cc
r9348 r9667 48 48 namespace orxonox 49 49 { 50 CreateUnloadableFactory(GametypeInfo);50 RegisterUnloadableClass(GametypeInfo); 51 51 52 52 registerMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage); … … 65 65 Registers and initializes the object. 66 66 */ 67 GametypeInfo::GametypeInfo( BaseObject* creator) : Info(creator)67 GametypeInfo::GametypeInfo(Context* context) : Info(context) 68 68 { 69 69 RegisterObject(GametypeInfo); -
code/trunk/src/orxonox/infos/GametypeInfo.h
r9348 r9667 58 58 59 59 public: 60 GametypeInfo( BaseObject* creator);60 GametypeInfo(Context* context); 61 61 virtual ~GametypeInfo(); 62 62 -
code/trunk/src/orxonox/infos/HumanPlayer.cc
r8327 r9667 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/ ConfigValueIncludes.h"32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "core/GameMode.h" 34 34 // #include "network/ClientInformation.h" … … 41 41 namespace orxonox 42 42 { 43 CreateUnloadableFactory(HumanPlayer);44 45 HumanPlayer::HumanPlayer( BaseObject* creator) : PlayerInfo(creator)43 RegisterUnloadableClass(HumanPlayer); 44 45 HumanPlayer::HumanPlayer(Context* context) : PlayerInfo(context) 46 46 { 47 47 RegisterObject(HumanPlayer); … … 183 183 if (this->isLocalPlayer() && !this->humanHudTemplate_.empty() && GameMode::showsGraphics()) 184 184 { 185 this->humanHud_ = new OverlayGroup(this );185 this->humanHud_ = new OverlayGroup(this->getContext()); 186 186 this->humanHud_->addTemplate(this->humanHudTemplate_); 187 187 this->humanHud_->setOwner(this); … … 199 199 if (this->isLocalPlayer() && !this->gametypeHudTemplate_.empty()) 200 200 { 201 this->gametypeHud_ = new OverlayGroup(this );201 this->gametypeHud_ = new OverlayGroup(this->getContext()); 202 202 this->gametypeHud_->addTemplate(this->gametypeHudTemplate_); 203 203 this->gametypeHud_->setOwner(this); -
code/trunk/src/orxonox/infos/HumanPlayer.h
r7163 r9667 40 40 { 41 41 public: 42 HumanPlayer( BaseObject* creator);42 HumanPlayer(Context* context); 43 43 virtual ~HumanPlayer(); 44 44 -
code/trunk/src/orxonox/infos/Info.cc
r5781 r9667 32 32 namespace orxonox 33 33 { 34 Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) 34 RegisterClass(Info); 35 36 Info::Info(Context* context) : BaseObject(context), Synchronisable(context) 35 37 { 36 38 RegisterObject(Info); -
code/trunk/src/orxonox/infos/Info.h
r5781 r9667 40 40 { 41 41 public: 42 Info( BaseObject* creator);42 Info(Context* context); 43 43 virtual ~Info() {} 44 44 }; -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r9348 r9667 40 40 namespace orxonox 41 41 { 42 PlayerInfo::PlayerInfo(BaseObject* creator) : Info(creator) 42 RegisterAbstractClass(PlayerInfo).inheritsFrom(Class(Info)); 43 44 PlayerInfo::PlayerInfo(Context* context) : Info(context) 43 45 { 44 46 RegisterObject(PlayerInfo); … … 136 138 this->controller_ = 0; 137 139 } 138 this->controller_ = this->defaultController_.fabricate(this );140 this->controller_ = this->defaultController_.fabricate(this->getContext()); 139 141 assert(this->controller_); 140 142 this->controller_->setPlayer(this); -
code/trunk/src/orxonox/infos/PlayerInfo.h
r8706 r9667 33 33 34 34 #include "Info.h" 35 #include "core/ SubclassIdentifier.h"35 #include "core/class/SubclassIdentifier.h" 36 36 37 37 namespace orxonox // tolua_export … … 41 41 { // tolua_export 42 42 public: 43 PlayerInfo( BaseObject* creator);43 PlayerInfo(Context* context); 44 44 virtual ~PlayerInfo(); 45 45 -
code/trunk/src/orxonox/interfaces/GametypeMessageListener.h
r7163 r9667 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include "core/ OrxonoxClass.h"33 #include "core/class/OrxonoxInterface.h" 34 34 35 35 namespace orxonox 36 36 { 37 class _OrxonoxExport GametypeMessageListener : virtual public Orxonox Class37 class _OrxonoxExport GametypeMessageListener : virtual public OrxonoxInterface 38 38 { 39 39 public: -
code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
r8706 r9667 50 50 // GametypeMessageListener 51 51 //---------------------------- 52 RegisterAbstractClass(GametypeMessageListener).inheritsFrom(Class(OrxonoxInterface)); 53 52 54 GametypeMessageListener::GametypeMessageListener() 53 55 { 54 Register RootObject(GametypeMessageListener);56 RegisterObject(GametypeMessageListener); 55 57 } 56 58 … … 58 60 // PlayerTrigger 59 61 //---------------------------- 62 RegisterAbstractClass(PlayerTrigger).inheritsFrom(Class(OrxonoxInterface)); 63 60 64 PlayerTrigger::PlayerTrigger() 61 65 { 62 Register RootObject(PlayerTrigger);66 RegisterObject(PlayerTrigger); 63 67 64 68 this->isForPlayer_ = false; … … 76 80 // RadarListener 77 81 //---------------------------- 82 RegisterAbstractClass(RadarListener).inheritsFrom(Class(OrxonoxInterface)); 83 78 84 RadarListener::RadarListener() 79 85 { 80 Register RootObject(RadarListener);86 RegisterObject(RadarListener); 81 87 } 82 88 … … 84 90 // TeamColourable 85 91 //---------------------------- 92 RegisterAbstractClass(TeamColourable).inheritsFrom(Class(OrxonoxInterface)); 93 86 94 TeamColourable::TeamColourable() 87 95 { 88 Register RootObject(TeamColourable);96 RegisterObject(TeamColourable); 89 97 } 90 98 … … 92 100 // Rewardable 93 101 //---------------------------- 102 RegisterAbstractClass(Rewardable).inheritsFrom(Class(OrxonoxInterface)); 103 94 104 Rewardable::Rewardable() 95 105 { 96 Register RootObject(Rewardable);106 RegisterObject(Rewardable); 97 107 } 98 108 } -
code/trunk/src/orxonox/interfaces/NotificationListener.cc
r8706 r9667 53 53 NotificationListener::NotificationListener() 54 54 { 55 Register RootObject(NotificationListener);55 RegisterObject(NotificationListener); 56 56 } 57 57 -
code/trunk/src/orxonox/interfaces/NotificationListener.h
r8706 r9667 44 44 #include "util/StringUtils.h" 45 45 46 #include "core/ OrxonoxClass.h"46 #include "core/class/OrxonoxInterface.h" 47 47 48 48 namespace orxonox … … 90 90 @todo Consistent terminology between message, notification and command. 91 91 */ 92 class _OrxonoxExport NotificationListener : virtual public Orxonox Class92 class _OrxonoxExport NotificationListener : virtual public OrxonoxInterface 93 93 { 94 94 public: -
code/trunk/src/orxonox/interfaces/PickupCarrier.cc
r8858 r9667 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/ Identifier.h"37 #include "core/class/Identifier.h" 38 38 39 39 #include "Pickupable.h" 40 40 41 namespace orxonox { 41 namespace orxonox 42 { 43 RegisterAbstractClass(PickupCarrier).inheritsFrom(Class(OrxonoxInterface)); 42 44 43 45 /** … … 47 49 PickupCarrier::PickupCarrier() 48 50 { 49 Register RootObject(PickupCarrier);51 RegisterObject(PickupCarrier); 50 52 } 51 53 -
code/trunk/src/orxonox/interfaces/PickupCarrier.h
r7552 r9667 41 41 #include <vector> 42 42 43 #include "core/ OrxonoxClass.h"43 #include "core/class/OrxonoxInterface.h" 44 44 45 45 namespace orxonox … … 66 66 @ingroup Pickup 67 67 */ 68 class _OrxonoxExport PickupCarrier : virtual public Orxonox Class68 class _OrxonoxExport PickupCarrier : virtual public OrxonoxInterface 69 69 { 70 70 // So that the different Pickupables have full access to their PickupCarrier. -
code/trunk/src/orxonox/interfaces/PickupListener.cc
r8351 r9667 47 47 PickupListener::PickupListener() 48 48 { 49 Register RootObject(PickupListener);49 RegisterObject(PickupListener); 50 50 } 51 51 -
code/trunk/src/orxonox/interfaces/PickupListener.h
r8351 r9667 39 39 #include "Pickupable.h" 40 40 41 #include "core/ OrxonoxClass.h"41 #include "core/class/OrxonoxInterface.h" 42 42 43 43 namespace orxonox … … 55 55 @ingroup Pickup 56 56 */ 57 class _OrxonoxExport PickupListener : virtual public Orxonox Class57 class _OrxonoxExport PickupListener : virtual public OrxonoxInterface 58 58 { 59 59 public: -
code/trunk/src/orxonox/interfaces/Pickupable.cc
r9348 r9667 34 34 #include "Pickupable.h" 35 35 36 #include "core/ Identifier.h"36 #include "core/class/Identifier.h" 37 37 #include "core/CoreIncludes.h" 38 38 #include "util/Convert.h" … … 46 46 namespace orxonox 47 47 { 48 RegisterAbstractClass(Pickupable).inheritsFrom(Class(OrxonoxInterface)).inheritsFrom(Class(Rewardable)); 48 49 49 50 /** … … 53 54 Pickupable::Pickupable() : used_(false), pickedUp_(false) 54 55 { 55 Register RootObject(Pickupable);56 RegisterObject(Pickupable); 56 57 57 58 this->carrier_ = NULL; … … 71 72 /** 72 73 @brief 73 A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.74 A method that is called by Destroyable::destroy() before the object is actually destroyed. 74 75 */ 75 76 void Pickupable::preDestroy(void) … … 98 99 { 99 100 if(!this->isBeingDestroyed()) 100 this-> OrxonoxClass::destroy();101 this->Destroyable::destroy(); 101 102 else 102 103 orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl; -
code/trunk/src/orxonox/interfaces/Pickupable.h
r9348 r9667 39 39 40 40 #include <list> 41 #include "core/ Super.h"41 #include "core/class/Super.h" 42 42 43 #include "core/ OrxonoxClass.h"43 #include "core/class/OrxonoxInterface.h" 44 44 #include "Rewardable.h" 45 45 … … 58 58 @ingroup Pickup 59 59 */ 60 class _OrxonoxExport Pickupable : virtual public Orxonox Class, public Rewardable60 class _OrxonoxExport Pickupable : virtual public OrxonoxInterface, public Rewardable 61 61 { 62 62 friend class PickupCarrier; … … 144 144 145 145 protected: 146 virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.146 virtual void preDestroy(void); //!< A method that is called by Destroyable::destroy() before the object is actually destroyed. 147 147 virtual void destroyPickup(void); //!< Destroys a Pickupable. 148 148 virtual void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed. -
code/trunk/src/orxonox/interfaces/PlayerTrigger.h
r8706 r9667 38 38 #include "OrxonoxPrereqs.h" 39 39 40 #include "core/ OrxonoxClass.h"41 #include "core/ WeakPtr.h"40 #include "core/class/OrxonoxInterface.h" 41 #include "core/object/WeakPtr.h" 42 42 43 43 namespace orxonox … … 52 52 @ingroup Triggers 53 53 */ 54 class _OrxonoxExport PlayerTrigger : virtual public Orxonox Class54 class _OrxonoxExport PlayerTrigger : virtual public OrxonoxInterface 55 55 { 56 56 public: -
code/trunk/src/orxonox/interfaces/RadarListener.h
r7163 r9667 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include "core/ OrxonoxClass.h"33 #include "core/class/OrxonoxInterface.h" 34 34 35 35 namespace orxonox 36 36 { 37 class _OrxonoxExport RadarListener : virtual public Orxonox Class37 class _OrxonoxExport RadarListener : virtual public OrxonoxInterface 38 38 { 39 39 public: -
code/trunk/src/orxonox/interfaces/RadarViewable.cc
r9526 r9667 38 38 namespace orxonox 39 39 { 40 RegisterAbstractClass(RadarViewable).inheritsFrom(Class(OrxonoxInterface)); 41 40 42 /** 41 43 @brief Constructor. … … 45 47 , bVisibility_(true) 46 48 , bInitialized_(false) 47 , creator_(creator)48 49 , wePtr_(wePtr) 49 50 , radarObjectCamouflage_(0.0f) … … 52 53 , scale_(1.0f) 53 54 { 54 Register RootObject(RadarViewable);55 RegisterObject(RadarViewable); 55 56 56 57 this->uniqueId_=getUniqueNumberString(); 57 58 if( GameMode::showsGraphics() ) 58 59 { 59 this->radar_ = this->creator_->getScene()->getRadar();60 this->radar_ = creator->getScene()->getRadar(); 60 61 this->radar_->addRadarObject(this); 61 62 } -
code/trunk/src/orxonox/interfaces/RadarViewable.h
r9526 r9667 36 36 37 37 #include "util/Math.h" 38 #include "core/ OrxonoxClass.h"39 #include "core/ SmartPtr.h"38 #include "core/class/OrxonoxInterface.h" 39 #include "core/object/SmartPtr.h" 40 40 41 41 namespace orxonox … … 46 46 @brief Interface for receiving window events. 47 47 */ 48 class _OrxonoxExport RadarViewable : virtual public Orxonox Class48 class _OrxonoxExport RadarViewable : virtual public OrxonoxInterface 49 49 { 50 50 public: … … 153 153 //Map 154 154 std::string uniqueId_; 155 BaseObject* creator_;156 155 157 156 -
code/trunk/src/orxonox/interfaces/Rewardable.h
r7163 r9667 36 36 37 37 #include "OrxonoxPrereqs.h" 38 #include "core/ OrxonoxClass.h"38 #include "core/class/OrxonoxInterface.h" 39 39 40 40 namespace orxonox … … 48 48 Damian 'Mozork' Frick 49 49 */ 50 class _OrxonoxExport Rewardable : virtual public Orxonox Class50 class _OrxonoxExport Rewardable : virtual public OrxonoxInterface 51 51 { 52 52 public: -
code/trunk/src/orxonox/interfaces/TeamColourable.h
r5781 r9667 33 33 34 34 #include "util/UtilPrereqs.h" 35 #include "core/ OrxonoxClass.h"35 #include "core/class/OrxonoxInterface.h" 36 36 37 37 namespace orxonox 38 38 { 39 class _OrxonoxExport TeamColourable : virtual public Orxonox Class39 class _OrxonoxExport TeamColourable : virtual public OrxonoxInterface 40 40 { 41 41 public: -
code/trunk/src/orxonox/items/Engine.cc
r8858 r9667 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/ ConfigValueIncludes.h"32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "core/Template.h" 34 34 #include "core/XMLPort.h" … … 40 40 namespace orxonox 41 41 { 42 CreateFactory(Engine);42 RegisterClass(Engine); 43 43 44 44 /** … … 46 46 Constructor. Registers and initializes the object. 47 47 */ 48 Engine::Engine( BaseObject* creator) : Item(creator)48 Engine::Engine(Context* context) : Item(context) 49 49 { 50 50 RegisterObject(Engine); -
code/trunk/src/orxonox/items/Engine.h
r8727 r9667 56 56 { 57 57 public: 58 Engine( BaseObject* creator);58 Engine(Context* context); 59 59 virtual ~Engine(); 60 60 -
code/trunk/src/orxonox/items/Item.cc
r5781 r9667 32 32 namespace orxonox 33 33 { 34 Item::Item(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) 34 RegisterClass(Item); 35 36 Item::Item(Context* context) : BaseObject(context), Synchronisable(context) 35 37 { 36 38 RegisterObject(Item); -
code/trunk/src/orxonox/items/Item.h
r5781 r9667 40 40 { 41 41 public: 42 Item( BaseObject* creator);42 Item(Context* context); 43 43 virtual ~Item() {} 44 44 }; -
code/trunk/src/orxonox/items/MultiStateEngine.cc
r8727 r9667 49 49 static const float MAX_VELOCITY_BOOST = 221; 50 50 51 CreateFactory(MultiStateEngine);52 53 MultiStateEngine::MultiStateEngine( BaseObject* creator) : Engine(creator)51 RegisterClass(MultiStateEngine); 52 53 MultiStateEngine::MultiStateEngine(Context* context) : Engine(context) 54 54 { 55 55 RegisterObject(MultiStateEngine); … … 57 57 if (GameMode::isMaster()) 58 58 { 59 this->defEngineSndNormal_ = new WorldSound(this );60 this->defEngineSndBoost_ = new WorldSound(this );59 this->defEngineSndNormal_ = new WorldSound(this->getContext()); 60 this->defEngineSndBoost_ = new WorldSound(this->getContext()); 61 61 this->defEngineSndNormal_->setLooping(true); 62 62 this->defEngineSndBoost_->setLooping(true); -
code/trunk/src/orxonox/items/MultiStateEngine.h
r8727 r9667 49 49 }; 50 50 51 MultiStateEngine( BaseObject* creator);51 MultiStateEngine(Context* context); 52 52 virtual ~MultiStateEngine(); 53 53 -
code/trunk/src/orxonox/overlays/GUISheet.cc
r7401 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(GUISheet);38 RegisterClass(GUISheet); 39 39 40 GUISheet::GUISheet( BaseObject* creator)41 : BaseObject(c reator)40 GUISheet::GUISheet(Context* context) 41 : BaseObject(context) 42 42 , bShowOnLoad_(false) 43 43 , bHidePrevious_(false) -
code/trunk/src/orxonox/overlays/GUISheet.h
r7401 r9667 41 41 { 42 42 public: 43 GUISheet( BaseObject* creator);43 GUISheet(Context* context); 44 44 ~GUISheet(); 45 45 -
code/trunk/src/orxonox/overlays/InGameConsole.cc
r9550 r9667 49 49 #include "util/output/OutputManager.h" 50 50 #include "core/CoreIncludes.h" 51 #include "core/ ConfigValueIncludes.h"51 #include "core/config/ConfigValueIncludes.h" 52 52 #include "core/command/ConsoleCommand.h" 53 53 #include "core/GUIManager.h" … … 110 110 111 111 // destroy the underlaying shell 112 this->shell_->destroy();112 delete this->shell_; 113 113 114 114 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r8858 r9667 63 63 SetConsoleCommand("OrxonoxOverlay", "rotateOverlay", &OrxonoxOverlay::rotateOverlay); 64 64 65 OrxonoxOverlay::OrxonoxOverlay(BaseObject* creator) 66 : BaseObject(creator) 65 RegisterClass(OrxonoxOverlay); 66 67 OrxonoxOverlay::OrxonoxOverlay(Context* context) 68 : BaseObject(context) 67 69 { 68 70 RegisterObject(OrxonoxOverlay); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r8706 r9667 42 42 #include "util/OgreForwardRefs.h" 43 43 #include "core/BaseObject.h" 44 #include "core/Super.h"45 44 #include "core/WindowEventListener.h" 45 #include "core/class/Super.h" 46 46 47 47 namespace orxonox … … 87 87 88 88 public: 89 OrxonoxOverlay( BaseObject* creator);89 OrxonoxOverlay(Context* context); 90 90 virtual ~OrxonoxOverlay(); 91 91 -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r8309 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(OverlayGroup);43 RegisterClass(OverlayGroup); 44 44 45 45 SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility); … … 48 48 SetConsoleCommand("OverlayGroup", "scrollGroup", &OverlayGroup::scrollGroup); 49 49 50 OverlayGroup::OverlayGroup( BaseObject* creator)51 : BaseObject(c reator)50 OverlayGroup::OverlayGroup(Context* context) 51 : BaseObject(context) 52 52 { 53 53 RegisterObject(OverlayGroup); … … 148 148 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 149 149 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 150 } 151 152 //! Changes the gametype of all elements 153 void OverlayGroup::changedGametype() 154 { 155 SUPER( OverlayGroup, changedGametype ); 156 157 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 158 (*it)->setGametype(this->getGametype()); 150 159 } 151 160 -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r8309 r9667 54 54 { 55 55 public: 56 OverlayGroup( BaseObject* creator);56 OverlayGroup(Context* context); 57 57 //! Empty destructor. 58 58 ~OverlayGroup(); … … 68 68 { return this->hudElements_; } 69 69 70 void changedVisibility(); 70 virtual void changedVisibility(); 71 virtual void changedGametype(); 71 72 72 73 void setOwner(BaseObject* owner); -
code/trunk/src/orxonox/sound/BaseSound.cc
r8858 r9667 43 43 namespace orxonox 44 44 { 45 RegisterAbstractClass(BaseSound).inheritsFrom(Class(Listable)); 46 45 47 BaseSound::BaseSound() 46 48 : bPooling_(false) … … 50 52 , pitch_ (1.0) 51 53 { 52 Register RootObject(BaseSound);54 RegisterObject(BaseSound); 53 55 54 56 // Initialise audioSource_ to a value that is not a source -
code/trunk/src/orxonox/sound/BaseSound.h
r7856 r9667 35 35 #include <boost/shared_ptr.hpp> 36 36 #include <OgreDataStream.h> 37 #include "core/ OrxonoxClass.h"37 #include "core/object/Listable.h" 38 38 39 39 namespace orxonox … … 43 43 * It serves as main interface to the OpenAL library. 44 44 */ 45 class _OrxonoxExport BaseSound : virtual public OrxonoxClass45 class _OrxonoxExport BaseSound : virtual public Listable 46 46 { 47 47 public: -
code/trunk/src/orxonox/sound/SoundManager.cc
r8903 r9667 39 39 #include "util/Clock.h" 40 40 #include "util/ScopedSingletonManager.h" 41 #include "core/ ConfigValueIncludes.h"41 #include "core/config/ConfigValueIncludes.h" 42 42 #include "core/CoreIncludes.h" 43 43 #include "core/GameMode.h" … … 69 69 : effectsPoolSize_(0) 70 70 { 71 Register RootObject(SoundManager);71 RegisterObject(SoundManager); 72 72 73 73 orxout(user_status) << "Loading sound" << endl; -
code/trunk/src/orxonox/sound/SoundManager.h
r8351 r9667 39 39 40 40 #include "util/Singleton.h" 41 #include "core/ OrxonoxClass.h"42 #include "core/ SmartPtr.h"41 #include "core/config/Configurable.h" 42 #include "core/object/SmartPtr.h" 43 43 44 44 // tolua_begin … … 59 59 class _OrxonoxExport SoundManager 60 60 // tolua_end 61 : public Singleton<SoundManager>, public OrxonoxClass61 : public Singleton<SoundManager>, public Configurable 62 62 { // tolua_export 63 63 friend class Singleton<SoundManager>; -
code/trunk/src/orxonox/sound/WorldAmbientSound.cc
r7854 r9667 36 36 namespace orxonox 37 37 { 38 CreateFactory(WorldAmbientSound);38 RegisterClass(WorldAmbientSound); 39 39 40 WorldAmbientSound::WorldAmbientSound( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)40 WorldAmbientSound::WorldAmbientSound(Context* context) : BaseObject(context), Synchronisable(context) 41 41 { 42 42 RegisterObject(WorldAmbientSound); -
code/trunk/src/orxonox/sound/WorldAmbientSound.h
r7854 r9667 44 44 { 45 45 public: 46 WorldAmbientSound( BaseObject* creator);46 WorldAmbientSound(Context* context); 47 47 virtual ~WorldAmbientSound(); 48 48 -
code/trunk/src/orxonox/sound/WorldSound.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(WorldSound);43 RegisterClass(WorldSound); 44 44 45 WorldSound::WorldSound( BaseObject* creator)46 : StaticEntity(c reator)45 WorldSound::WorldSound(Context* context) 46 : StaticEntity(context) 47 47 { 48 48 RegisterObject(WorldSound); -
code/trunk/src/orxonox/sound/WorldSound.h
r7854 r9667 45 45 { 46 46 public: 47 WorldSound( BaseObject* creator);47 WorldSound(Context* context); 48 48 49 49 void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.cc
r5781 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(DefaultWeaponmodeLink);37 RegisterClass(DefaultWeaponmodeLink); 38 38 39 DefaultWeaponmodeLink::DefaultWeaponmodeLink( BaseObject* creator) : BaseObject(creator)39 DefaultWeaponmodeLink::DefaultWeaponmodeLink(Context* context) : BaseObject(context) 40 40 { 41 41 RegisterObject(DefaultWeaponmodeLink); -
code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h
r5781 r9667 39 39 { 40 40 public: 41 DefaultWeaponmodeLink( BaseObject* creator);41 DefaultWeaponmodeLink(Context* context); 42 42 virtual ~DefaultWeaponmodeLink(); 43 43 -
code/trunk/src/orxonox/weaponsystem/Munition.cc
r8729 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(Munition);38 39 Munition::Munition( BaseObject* creator) : BaseObject(creator)37 RegisterClass(Munition); 38 39 Munition::Munition(Context* context) : BaseObject(context) 40 40 { 41 41 RegisterObject(Munition); -
code/trunk/src/orxonox/weaponsystem/Munition.h
r7851 r9667 56 56 57 57 public: 58 Munition( BaseObject* creator);58 Munition(Context* context); 59 59 virtual ~Munition(); 60 60 -
code/trunk/src/orxonox/weaponsystem/Weapon.cc
r5929 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(Weapon);41 RegisterClass(Weapon); 42 42 43 Weapon::Weapon( BaseObject* creator) : StaticEntity(creator)43 Weapon::Weapon(Context* context) : StaticEntity(context) 44 44 { 45 45 RegisterObject(Weapon); -
code/trunk/src/orxonox/weaponsystem/Weapon.h
r5929 r9667 42 42 { 43 43 public: 44 Weapon( BaseObject* creator);44 Weapon(Context* context); 45 45 virtual ~Weapon(); 46 46 -
code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
r8858 r9667 45 45 namespace orxonox 46 46 { 47 WeaponMode::WeaponMode(BaseObject* creator) : BaseObject(creator) 47 RegisterAbstractClass(WeaponMode).inheritsFrom(Class(BaseObject)); 48 49 WeaponMode::WeaponMode(Context* context) : BaseObject(context) 48 50 { 49 51 RegisterObject(WeaponMode); … … 75 77 if( GameMode::isMaster() ) 76 78 { 77 this->defSndWpnFire_ = new WorldSound(this );79 this->defSndWpnFire_ = new WorldSound(this->getContext()); 78 80 this->defSndWpnFire_->setLooping(false); 79 81 this->bSoundAttached_ = false; -
code/trunk/src/orxonox/weaponsystem/WeaponMode.h
r8706 r9667 36 36 #include "util/Math.h" 37 37 #include "core/BaseObject.h" 38 #include "core/ SubclassIdentifier.h"38 #include "core/class/SubclassIdentifier.h" 39 39 #include "tools/Timer.h" 40 40 … … 44 44 { 45 45 public: 46 WeaponMode( BaseObject* creator);46 WeaponMode(Context* context); 47 47 virtual ~WeaponMode(); 48 48 -
code/trunk/src/orxonox/weaponsystem/WeaponPack.cc
r6417 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(WeaponPack);40 RegisterClass(WeaponPack); 41 41 42 WeaponPack::WeaponPack( BaseObject* creator) : BaseObject(creator)42 WeaponPack::WeaponPack(Context* context) : BaseObject(context) 43 43 { 44 44 RegisterObject(WeaponPack); -
code/trunk/src/orxonox/weaponsystem/WeaponPack.h
r6417 r9667 41 41 { 42 42 public: 43 WeaponPack( BaseObject* creator);43 WeaponPack(Context* context); 44 44 virtual ~WeaponPack(); 45 45 -
code/trunk/src/orxonox/weaponsystem/WeaponSet.cc
r5781 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(WeaponSet);39 RegisterClass(WeaponSet); 40 40 41 WeaponSet::WeaponSet( BaseObject* creator) : BaseObject(creator)41 WeaponSet::WeaponSet(Context* context) : BaseObject(context) 42 42 { 43 43 RegisterObject(WeaponSet); -
code/trunk/src/orxonox/weaponsystem/WeaponSet.h
r5781 r9667 41 41 { 42 42 public: 43 WeaponSet( BaseObject* creator);43 WeaponSet(Context* context); 44 44 virtual ~WeaponSet(); 45 45 -
code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
r8706 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(WeaponSlot);39 RegisterClass(WeaponSlot); 40 40 41 WeaponSlot::WeaponSlot( BaseObject* creator) : StaticEntity(creator)41 WeaponSlot::WeaponSlot(Context* context) : StaticEntity(context) 42 42 { 43 43 RegisterObject(WeaponSlot); -
code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
r8891 r9667 57 57 { 58 58 public: 59 WeaponSlot( BaseObject* creator);59 WeaponSlot(Context* context); 60 60 virtual ~WeaponSlot(); 61 61 -
code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc
r8729 r9667 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/ SubclassIdentifier.h"32 #include "core/class/SubclassIdentifier.h" 33 33 #include "worldentities/pawns/Pawn.h" 34 34 … … 46 46 namespace orxonox 47 47 { 48 CreateFactory(WeaponSystem);49 50 WeaponSystem::WeaponSystem( BaseObject* creator) : BaseObject(creator)48 RegisterClass(WeaponSystem); 49 50 WeaponSystem::WeaponSystem(Context* context) : BaseObject(context) 51 51 { 52 52 RegisterObject(WeaponSystem); … … 308 308 else if (identifier->getIdentifier()->isA(Class(Munition))) 309 309 { 310 Munition* munition = identifier->fabricate(this );310 Munition* munition = identifier->fabricate(this->getContext()); 311 311 this->munitions_[identifier->getIdentifier()] = munition; 312 312 return munition; -
code/trunk/src/orxonox/weaponsystem/WeaponSystem.h
r6417 r9667 43 43 { 44 44 public: 45 WeaponSystem( BaseObject* creator);45 WeaponSystem(Context* context); 46 46 virtual ~WeaponSystem(); 47 47 -
code/trunk/src/orxonox/worldentities/BigExplosion.cc
r8858 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(BigExplosion);44 45 BigExplosion::BigExplosion( BaseObject* creator) : StaticEntity(creator)43 RegisterClass(BigExplosion); 44 45 BigExplosion::BigExplosion(Context* context) : StaticEntity(context) 46 46 { 47 47 RegisterObject(BigExplosion); … … 80 80 void BigExplosion::init() 81 81 { 82 this->debrisEntity1_ = new MovableEntity(this );83 this->debrisEntity2_ = new MovableEntity(this );84 this->debrisEntity3_ = new MovableEntity(this );85 this->debrisEntity4_ = new MovableEntity(this );82 this->debrisEntity1_ = new MovableEntity(this->getContext()); 83 this->debrisEntity2_ = new MovableEntity(this->getContext()); 84 this->debrisEntity3_ = new MovableEntity(this->getContext()); 85 this->debrisEntity4_ = new MovableEntity(this->getContext()); 86 86 87 87 this->debrisEntity1_->setSyncMode(0); … … 90 90 this->debrisEntity4_->setSyncMode(0); 91 91 92 this->debris1_ = new Model(this );93 this->debris2_ = new Model(this );94 this->debris3_ = new Model(this );95 this->debris4_ = new Model(this );92 this->debris1_ = new Model(this->getContext()); 93 this->debris2_ = new Model(this->getContext()); 94 this->debris3_ = new Model(this->getContext()); 95 this->debris4_ = new Model(this->getContext()); 96 96 97 97 this->debris1_->setSyncMode(0); … … 100 100 this->debris4_->setSyncMode(0); 101 101 102 this->explosion_ = new StaticEntity(this );102 this->explosion_ = new StaticEntity(this->getContext()); 103 103 this->explosion_->setSyncMode(0); 104 104 … … 148 148 this->debrisEntity4_->attach(debris4_); 149 149 150 ParticleSpawner* effect = new ParticleSpawner(this->getC reator());150 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 151 151 effect->setDestroyAfterLife(true); 152 152 effect->setSource("Orxonox/explosion2b"); … … 154 154 effect->setSyncMode(0); 155 155 156 ParticleSpawner* effect2 = new ParticleSpawner(this->getC reator());156 ParticleSpawner* effect2 = new ParticleSpawner(this->getContext()); 157 157 effect2->setDestroyAfterLife(true); 158 158 effect2->setSource("Orxonox/smoke6"); … … 172 172 for(int i=0;i<10;i++) 173 173 { 174 Model* part1 = new Model(this );175 Model* part2 = new Model(this );176 177 MovableEntity* partEntity1 = new MovableEntity(this );178 MovableEntity* partEntity2 = new MovableEntity(this );174 Model* part1 = new Model(this->getContext()); 175 Model* part2 = new Model(this->getContext()); 176 177 MovableEntity* partEntity1 = new MovableEntity(this->getContext()); 178 MovableEntity* partEntity2 = new MovableEntity(this->getContext()); 179 179 180 180 part1->setSyncMode(0); … … 225 225 { 226 226 this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem()); 227 this->debrisFire1_->destroy();227 delete this->debrisFire1_; 228 228 } 229 229 if (this->debrisSmoke1_) 230 230 { 231 231 this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem()); 232 this->debrisSmoke1_->destroy();232 delete this->debrisSmoke1_; 233 233 } 234 234 … … 236 236 { 237 237 this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem()); 238 this->debrisFire2_->destroy();238 delete this->debrisFire2_; 239 239 } 240 240 if (this->debrisSmoke2_) 241 241 { 242 242 this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem()); 243 this->debrisSmoke2_->destroy();243 delete this->debrisSmoke2_; 244 244 } 245 245 … … 247 247 { 248 248 this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem()); 249 this->debrisFire3_->destroy();249 delete this->debrisFire3_; 250 250 } 251 251 if (this->debrisSmoke3_) 252 252 { 253 253 this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem()); 254 this->debrisSmoke3_->destroy();254 delete this->debrisSmoke3_; 255 255 } 256 256 … … 258 258 { 259 259 this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem()); 260 this->debrisFire4_->destroy();260 delete this->debrisFire4_; 261 261 } 262 262 if (this->debrisSmoke4_) 263 263 { 264 264 this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem()); 265 this->debrisSmoke4_->destroy();265 delete this->debrisSmoke4_; 266 266 } 267 267 } -
code/trunk/src/orxonox/worldentities/BigExplosion.h
r7176 r9667 40 40 { 41 41 public: 42 BigExplosion( BaseObject* creator);42 BigExplosion(Context* context); 43 43 virtual ~BigExplosion(); 44 44 -
code/trunk/src/orxonox/worldentities/CameraPosition.cc
r8706 r9667 35 35 namespace orxonox 36 36 { 37 CreateFactory(CameraPosition);37 RegisterClass(CameraPosition); 38 38 39 CameraPosition::CameraPosition( BaseObject* creator) : StaticEntity(creator)39 CameraPosition::CameraPosition(Context* context) : StaticEntity(context) 40 40 { 41 41 RegisterObject(CameraPosition); -
code/trunk/src/orxonox/worldentities/CameraPosition.h
r5781 r9667 38 38 { 39 39 public: 40 CameraPosition( BaseObject* creator);40 CameraPosition(Context* context); 41 41 virtual ~CameraPosition(); 42 42 -
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r9348 r9667 33 33 34 34 #include "core/CoreIncludes.h" 35 #include "core/ ConfigValueIncludes.h"35 #include "core/config/ConfigValueIncludes.h" 36 36 #include "core/GameMode.h" 37 37 #include "core/XMLPort.h" … … 47 47 namespace orxonox 48 48 { 49 CreateFactory(ControllableEntity);49 RegisterClass(ControllableEntity); 50 50 51 51 registerMemberNetworkFunction( ControllableEntity, fire ); 52 52 registerMemberNetworkFunction( ControllableEntity, setTargetInternal ); 53 53 54 ControllableEntity::ControllableEntity( BaseObject* creator) : MobileEntity(creator)54 ControllableEntity::ControllableEntity(Context* context) : MobileEntity(context) 55 55 { 56 56 RegisterObject(ControllableEntity); … … 397 397 if (!this->camera_ && GameMode::showsGraphics()) 398 398 { 399 this->camera_ = new Camera(this );399 this->camera_ = new Camera(this->getContext()); 400 400 this->camera_->requestFocus(); 401 401 if (!this->cameraPositionTemplate_.empty()) … … 423 423 if (!this->hudtemplate_.empty()) 424 424 { 425 this->hud_ = new OverlayGroup(this );425 this->hud_ = new OverlayGroup(this->getContext()); 426 426 this->hud_->addTemplate(this->hudtemplate_); 427 427 this->hud_->setOwner(this); -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r9348 r9667 44 44 45 45 public: 46 ControllableEntity( BaseObject* creator);46 ControllableEntity(Context* context); 47 47 virtual ~ControllableEntity(); 48 48 -
code/trunk/src/orxonox/worldentities/Drone.cc
r7163 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(Drone);36 RegisterClass(Drone); 37 37 /** 38 38 @brief 39 39 Constructor. Registers the object and initializes some default values. 40 40 */ 41 Drone::Drone( BaseObject* creator) : Pawn(creator)41 Drone::Drone(Context* context) : Pawn(context) 42 42 { 43 43 RegisterObject(Drone); … … 50 50 this->setCollisionType(WorldEntity::Dynamic); 51 51 52 myController_ = new DroneController( static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.52 myController_ = new DroneController(this->getContext()); //!< Creates a new controller and passes our this pointer to it as creator. 53 53 myController_->setDrone(this); 54 54 -
code/trunk/src/orxonox/worldentities/Drone.h
r7163 r9667 47 47 { 48 48 public: 49 Drone( BaseObject* creator);49 Drone(Context* context); 50 50 virtual ~Drone(); 51 51 -
code/trunk/src/orxonox/worldentities/EffectContainer.cc
r6417 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(EffectContainer);42 RegisterClass(EffectContainer); 43 43 44 EffectContainer::EffectContainer( BaseObject* creator)45 : BaseObject(c reator)44 EffectContainer::EffectContainer(Context* context) 45 : BaseObject(context) 46 46 , lua_(NULL) 47 47 { -
code/trunk/src/orxonox/worldentities/EffectContainer.h
r6417 r9667 40 40 { 41 41 public: 42 EffectContainer( BaseObject* creator);42 EffectContainer(Context* context); 43 43 virtual ~EffectContainer(); 44 44 -
code/trunk/src/orxonox/worldentities/ExplosionChunk.cc
r8858 r9667 38 38 namespace orxonox 39 39 { 40 CreateFactory(ExplosionChunk);40 RegisterClass(ExplosionChunk); 41 41 42 ExplosionChunk::ExplosionChunk( BaseObject* creator) : MovableEntity(creator)42 ExplosionChunk::ExplosionChunk(Context* context) : MovableEntity(context) 43 43 { 44 44 RegisterObject(ExplosionChunk); … … 92 92 { 93 93 this->detachOgreObject(this->fire_->getParticleSystem()); 94 this->fire_->destroy();94 delete this->fire_; 95 95 } 96 96 if (this->smoke_) 97 97 { 98 98 this->detachOgreObject(this->smoke_->getParticleSystem()); 99 this->smoke_->destroy();99 delete this->smoke_; 100 100 } 101 101 } -
code/trunk/src/orxonox/worldentities/ExplosionChunk.h
r7163 r9667 40 40 { 41 41 public: 42 ExplosionChunk( BaseObject* creator);42 ExplosionChunk(Context* context); 43 43 virtual ~ExplosionChunk(); 44 44 -
code/trunk/src/orxonox/worldentities/MobileEntity.cc
r8858 r9667 39 39 namespace orxonox 40 40 { 41 MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator) 41 RegisterClass(MobileEntity); 42 43 MobileEntity::MobileEntity(Context* context) : WorldEntity(context) 42 44 { 43 45 RegisterObject(MobileEntity); -
code/trunk/src/orxonox/worldentities/MobileEntity.h
r8727 r9667 41 41 { 42 42 public: 43 MobileEntity( BaseObject* creator);43 MobileEntity(Context* context); 44 44 virtual ~MobileEntity(); 45 45 -
code/trunk/src/orxonox/worldentities/MovableEntity.cc
r7284 r9667 41 41 static const float CONTINUOUS_SYNCHRONIZATION_TIME = 10.0f; 42 42 43 CreateFactory(MovableEntity);43 RegisterClass(MovableEntity); 44 44 45 MovableEntity::MovableEntity( BaseObject* creator) : MobileEntity(creator)45 MovableEntity::MovableEntity(Context* context) : MobileEntity(context) 46 46 { 47 47 RegisterObject(MovableEntity); -
code/trunk/src/orxonox/worldentities/MovableEntity.h
r7163 r9667 43 43 { 44 44 public: 45 MovableEntity( BaseObject* creator);45 MovableEntity(Context* context); 46 46 virtual ~MovableEntity(); 47 47 -
code/trunk/src/orxonox/worldentities/SpawnPoint.cc
r8858 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(SpawnPoint);39 RegisterClass(SpawnPoint); 40 40 41 SpawnPoint::SpawnPoint( BaseObject* creator) : StaticEntity(creator)41 SpawnPoint::SpawnPoint(Context* context) : StaticEntity(context) 42 42 { 43 43 RegisterObject(SpawnPoint); … … 81 81 Pawn* SpawnPoint::spawn() 82 82 { 83 Pawn* entity = this->spawnclass_.fabricate(this );83 Pawn* entity = this->spawnclass_.fabricate(this->getContext()); 84 84 if (entity) 85 85 { -
code/trunk/src/orxonox/worldentities/SpawnPoint.h
r5929 r9667 33 33 34 34 #include <string> 35 #include "core/ SubclassIdentifier.h"35 #include "core/class/SubclassIdentifier.h" 36 36 #include "worldentities/StaticEntity.h" 37 37 … … 41 41 { 42 42 public: 43 SpawnPoint( BaseObject* creator);43 SpawnPoint(Context* context); 44 44 virtual ~SpawnPoint() {} 45 45 -
code/trunk/src/orxonox/worldentities/StaticEntity.cc
r8858 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(StaticEntity);39 RegisterClass(StaticEntity); 40 40 41 StaticEntity::StaticEntity( BaseObject* creator) : WorldEntity(creator)41 StaticEntity::StaticEntity(Context* context) : WorldEntity(context) 42 42 { 43 43 RegisterObject(StaticEntity); -
code/trunk/src/orxonox/worldentities/StaticEntity.h
r7163 r9667 39 39 { 40 40 public: 41 StaticEntity( BaseObject* creator);41 StaticEntity(Context* context); 42 42 virtual ~StaticEntity(); 43 43 -
code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc
r5781 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(TeamSpawnPoint);36 RegisterClass(TeamSpawnPoint); 37 37 38 TeamSpawnPoint::TeamSpawnPoint( BaseObject* creator) : SpawnPoint(creator)38 TeamSpawnPoint::TeamSpawnPoint(Context* context) : SpawnPoint(context) 39 39 { 40 40 RegisterObject(TeamSpawnPoint); -
code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h
r5781 r9667 40 40 { 41 41 public: 42 TeamSpawnPoint( BaseObject* creator);42 TeamSpawnPoint(Context* context); 43 43 virtual ~TeamSpawnPoint() {} 44 44 -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r8858 r9667 61 61 BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD == (int)WorldEntity::World); 62 62 63 RegisterAbstractClass(WorldEntity).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable)); 64 63 65 /** 64 66 @brief … … 66 68 All the default values are being set here. 67 69 */ 68 WorldEntity::WorldEntity( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)70 WorldEntity::WorldEntity(Context* context) : BaseObject(context), Synchronisable(context) 69 71 { 70 72 RegisterObject(WorldEntity); … … 92 94 this->bPhysicsActiveSynchronised_ = false; 93 95 this->bPhysicsActiveBeforeAttaching_ = false; 94 this->collisionShape_ = new WorldEntityCollisionShape(this); 96 this->collisionShape_ = new WorldEntityCollisionShape(this->getContext()); 97 this->collisionShape_->setWorldEntityOwner(this); 95 98 this->collisionType_ = None; 96 99 this->collisionTypeSynchronised_ = None; -
code/trunk/src/orxonox/worldentities/WorldEntity.h
r7910 r9667 90 90 91 91 public: 92 WorldEntity( BaseObject* creator);92 WorldEntity(Context* context); 93 93 virtual ~WorldEntity(); 94 94 -
code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
r5929 r9667 34 34 namespace orxonox 35 35 { 36 CreateFactory(Destroyer);36 RegisterClass(Destroyer); 37 37 38 Destroyer::Destroyer( BaseObject* creator) : SpaceShip(creator)38 Destroyer::Destroyer(Context* context) : SpaceShip(context) 39 39 { 40 40 RegisterObject(Destroyer); -
code/trunk/src/orxonox/worldentities/pawns/Destroyer.h
r5781 r9667 39 39 { 40 40 public: 41 Destroyer( BaseObject* creator);41 Destroyer(Context* context); 42 42 virtual ~Destroyer() {}; 43 43 -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc
r9016 r9667 38 38 39 39 #include "core/CoreIncludes.h" 40 #include "core/ ConfigValueIncludes.h"40 #include "core/config/ConfigValueIncludes.h" 41 41 #include "core/Template.h" 42 42 #include "core/XMLPort.h" … … 53 53 const float orientationGain_ = 100; 54 54 const float jumpValue_ = 300; 55 CreateFactory(FpsPlayer);56 57 FpsPlayer::FpsPlayer( BaseObject* creator) : Pawn(creator)55 RegisterClass(FpsPlayer); 56 57 FpsPlayer::FpsPlayer(Context* context) : Pawn(context) 58 58 { 59 59 RegisterObject(FpsPlayer); -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
r9016 r9667 43 43 { 44 44 public: 45 FpsPlayer( BaseObject* creator);45 FpsPlayer(Context* context); 46 46 virtual ~FpsPlayer(); 47 47 -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r9666 r9667 51 51 namespace orxonox 52 52 { 53 CreateFactory(Pawn);54 55 Pawn::Pawn( BaseObject* creator)56 : ControllableEntity(c reator)57 , RadarViewable( creator, static_cast<WorldEntity*>(this))53 RegisterClass(Pawn); 54 55 Pawn::Pawn(Context* context) 56 : ControllableEntity(context) 57 , RadarViewable(this, static_cast<WorldEntity*>(this)) 58 58 { 59 59 RegisterObject(Pawn); … … 86 86 if (GameMode::isMaster()) 87 87 { 88 this->weaponSystem_ = new WeaponSystem(this );88 this->weaponSystem_ = new WeaponSystem(this->getContext()); 89 89 this->weaponSystem_->setPawn(this); 90 90 } … … 299 299 if (!this->spawnparticlesource_.empty()) 300 300 { 301 ParticleSpawner* effect = new ParticleSpawner(this->getC reator());301 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 302 302 effect->setPosition(this->getPosition()); 303 303 effect->setOrientation(this->getOrientation()); … … 365 365 this->setDestroyWhenPlayerLeft(false); 366 366 367 BigExplosion* chunk = new BigExplosion(this->getC reator());367 BigExplosion* chunk = new BigExplosion(this->getContext()); 368 368 chunk->setPosition(this->getPosition()); 369 369 … … 373 373 // play death effect 374 374 { 375 ParticleSpawner* effect = new ParticleSpawner(this->getC reator());375 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 376 376 effect->setPosition(this->getPosition()); 377 377 effect->setOrientation(this->getOrientation()); … … 381 381 } 382 382 { 383 ParticleSpawner* effect = new ParticleSpawner(this->getC reator());383 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 384 384 effect->setPosition(this->getPosition()); 385 385 effect->setOrientation(this->getOrientation()); … … 389 389 } 390 390 { 391 ParticleSpawner* effect = new ParticleSpawner(this->getC reator());391 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 392 392 effect->setPosition(this->getPosition()); 393 393 effect->setOrientation(this->getOrientation()); … … 398 398 for (unsigned int i = 0; i < this->numexplosionchunks_; ++i) 399 399 { 400 ExplosionChunk* chunk = new ExplosionChunk(this->getC reator());400 ExplosionChunk* chunk = new ExplosionChunk(this->getContext()); 401 401 chunk->setPosition(this->getPosition()); 402 402 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r9625 r9667 45 45 46 46 public: 47 Pawn( BaseObject* creator);47 Pawn(Context* context); 48 48 virtual ~Pawn(); 49 49 -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r9348 r9667 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "core/ ConfigValueIncludes.h"34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/Template.h" 36 36 #include "core/XMLPort.h" … … 46 46 namespace orxonox 47 47 { 48 CreateFactory(SpaceShip);49 50 SpaceShip::SpaceShip( BaseObject* creator) : Pawn(creator), boostBlur_(NULL)48 RegisterClass(SpaceShip); 49 50 SpaceShip::SpaceShip(Context* context) : Pawn(context), boostBlur_(NULL) 51 51 { 52 52 RegisterObject(SpaceShip); … … 96 96 97 97 if (this->boostBlur_) 98 this->boostBlur_->destroy();98 delete this->boostBlur_; 99 99 } 100 100 } … … 447 447 if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL) 448 448 { 449 this->boostBlur_->destroy();449 delete this->boostBlur_; 450 450 this->boostBlur_ = NULL; 451 451 } -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
r8727 r9667 88 88 { 89 89 public: 90 SpaceShip( BaseObject* creator);90 SpaceShip(Context* context); 91 91 virtual ~SpaceShip(); 92 92 -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r7863 r9667 31 31 #include "util/Convert.h" 32 32 #include "core/CoreIncludes.h" 33 #include "core/ ConfigValueIncludes.h"33 #include "core/config/ConfigValueIncludes.h" 34 34 #include "core/GameMode.h" 35 35 #include "core/command/CommandExecutor.h" … … 45 45 extern const std::string __CC_suicide_name; 46 46 47 CreateFactory(Spectator);48 49 Spectator::Spectator( BaseObject* creator) : ControllableEntity(creator)47 RegisterClass(Spectator); 48 49 Spectator::Spectator(Context* context) : ControllableEntity(context) 50 50 { 51 51 RegisterObject(Spectator); -
code/trunk/src/orxonox/worldentities/pawns/Spectator.h
r7862 r9667 40 40 { 41 41 public: 42 Spectator( BaseObject* creator);42 Spectator(Context* context); 43 43 virtual ~Spectator(); 44 44 -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
r5929 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(TeamBaseMatchBase);39 RegisterClass(TeamBaseMatchBase); 40 40 41 TeamBaseMatchBase::TeamBaseMatchBase( BaseObject* creator) : Pawn(creator)41 TeamBaseMatchBase::TeamBaseMatchBase(Context* context) : Pawn(context) 42 42 { 43 43 RegisterObject(TeamBaseMatchBase); -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h
r5781 r9667 50 50 { 51 51 public: 52 TeamBaseMatchBase( BaseObject* creator);52 TeamBaseMatchBase(Context* context); 53 53 54 54 // if class closes, close everything -
code/trunk/test/CMakeLists.txt
r9473 r9667 53 53 54 54 ADD_SUBDIRECTORY(util) 55 ADD_SUBDIRECTORY(core)
Note: See TracChangeset
for help on using the changeset viewer.