Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9667


Ignore:
Timestamp:
Aug 25, 2013, 9:08:42 PM (11 years ago)
Author:
landauf
Message:

merged core6 back to trunk

Location:
code/trunk
Files:
25 deleted
588 edited
8 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/SourceConfig.cmake

    r9550 r9667  
    9999  # All includes in "externals" should be prefixed with the path
    100100  # relative to "external" to avoid conflicts
    101   ${CMAKE_CURRENT_SOURCE_DIR}/external
     101  ../src/external
    102102  # Include directories needed even if only included by Orxonox
    103   ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet
    104   ${CMAKE_CURRENT_SOURCE_DIR}/external/ois
     103  ../src/external/bullet
     104  ../src/external/ois
    105105
    106106  # External
  • code/trunk/src/libraries/core/BaseObject.cc

    r8858 r9667  
    3939#include "Event.h"
    4040#include "EventIncludes.h"
    41 #include "Iterator.h"
    4241#include "Template.h"
    4342#include "XMLFile.h"
     
    4544#include "XMLPort.h"
    4645#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...
    4749
    4850namespace orxonox
    4951{
    50     CreateFactory(BaseObject);
     52    RegisterClass(BaseObject);
    5153
    5254    /**
    5355        @brief Constructor: Registers the object in the BaseObject-list.
    5456    */
    55     BaseObject::BaseObject(BaseObject* creator) : bInitialized_(false)
    56     {
    57         RegisterRootObject(BaseObject);
     57    BaseObject::BaseObject(Context* context) : bInitialized_(false)
     58    {
     59        RegisterObject(BaseObject);
    5860
    5961        this->bInitialized_ = true;
     
    6870        this->mainStateFunctor_ = 0;
    6971
     72        if (context)
     73            this->setContext(context);
     74
     75        BaseObject* creator = orxonox_cast<BaseObject*>(context);
    7076        this->setCreator(creator);
    7177        if (this->creator_)
     
    199205        {
    200206            this->networkTemplateNames_.insert(temp->getLink());
    201            
     207
    202208            Template* link;
    203209            assert(!(link = Template::getTemplate(temp->getLink())) || !link->isLink());
  • code/trunk/src/libraries/core/BaseObject.h

    r7401 r9667  
    4949
    5050#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"
    5454
    5555namespace orxonox
     
    6060
    6161    /// The BaseObject is the parent of all classes representing an instance in the game.
    62     class _CoreExport BaseObject : virtual public OrxonoxClass
     62    class _CoreExport BaseObject : public OrxonoxClass
    6363    {
    6464        template <class T> friend class XMLPortClassParamContainer;
    6565
    6666        public:
    67             BaseObject(BaseObject* creator);
     67            BaseObject(Context* context);
    6868            virtual ~BaseObject();
    6969            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/libraries/core/CMakeLists.txt

    r8858 r9667  
    2222#BUILD_UNIT CoreStableBuildUnit.cc
    2323  ClassTreeMask.cc
    24   CommandLineParser.cc
    25   ConfigValueContainer.cc
    2624  DynLib.cc
    2725  DynLibManager.cc
     
    3028  GameMode.cc
    3129  GameState.cc
    32   Identifier.cc
    3330  Language.cc
    3431  Loader.cc
    3532  LuaState.cc
    36   MetaObjectList.cc
    3733  Namespace.cc
    3834  NamespaceNode.cc
    39   ObjectListBase.cc
    40   OrxonoxClass.cc
    4135  Template.cc
    4236  ViewportEventListener.cc
     
    5751BUILD_UNIT FilesystemBuildUnit.cc
    5852  command/ArgumentCompletionFunctions.cc
    59   ConfigFileManager.cc
     53  config/ConfigFile.cc
    6054  PathConfig.cc
    6155END_BUILD_UNIT
     
    6862)
    6963
     64ADD_SUBDIRECTORY(class)
    7065ADD_SUBDIRECTORY(command)
     66ADD_SUBDIRECTORY(config)
    7167ADD_SUBDIRECTORY(input)
     68ADD_SUBDIRECTORY(object)
    7269
    7370ORXONOX_ADD_LIBRARY(core
     
    7572  TOLUA_FILES
    7673    command/CommandExecutor.h
    77     ConfigFileManager.h
     74    config/SettingsConfigFile.h
    7875    Game.h
    7976    GameMode.h
  • code/trunk/src/libraries/core/ClassTreeMask.cc

    r7401 r9667  
    3333
    3434#include "ClassTreeMask.h"
    35 #include "Identifier.h"
     35#include "class/Identifier.h"
    3636
    3737namespace orxonox
     
    849849        // If there is a first subclass, move the object-iterator to the first object of this class. Else go to the end
    850850        if (this->subclassIterator_ != this->subclasses_.end())
    851             this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
     851            this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin();
    852852        else
    853853            this->objectIterator_ = ObjectList<BaseObject>::end();
     
    881881                    // Check if there really is a next class. If yes, move the object-iterator to the first object
    882882                    if (this->subclassIterator_ != this->subclasses_.end())
    883                         this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
     883                        this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin();
    884884                    else
    885885                        return (*this);
  • code/trunk/src/libraries/core/ClassTreeMask.h

    r7401 r9667  
    7373#include <stack>
    7474#include "BaseObject.h"
    75 #include "Iterator.h"
     75#include "object/Iterator.h"
    7676
    7777namespace orxonox
  • code/trunk/src/libraries/core/Core.cc

    r9550 r9667  
    6060#include "util/SignalHandler.h"
    6161#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"
    6565#include "CoreIncludes.h"
    6666#include "DynLibManager.h"
     
    6868#include "GraphicsManager.h"
    6969#include "GUIManager.h"
    70 #include "Identifier.h"
     70#include "class/Identifier.h"
    7171#include "Language.h"
    7272#include "LuaState.h"
    73 #include "ObjectList.h"
    7473#include "command/ConsoleCommand.h"
    7574#include "command/IOConsole.h"
     
    7776#include "command/TclThreadManager.h"
    7877#include "input/InputManager.h"
     78#include "object/ObjectList.h"
    7979
    8080namespace orxonox
     
    9191    SetCommandLineArgument(limitToCPU, 0).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is off = 0.");
    9292#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));
    9396
    9497    Core::Core(const std::string& cmdLine)
     
    176179        // Do this soon after the ConfigFileManager has been created to open up the
    177180        // possibility to configure everything below here
    178         RegisterRootObject(Core);
     181        RegisterObject(Core);
    179182        orxout(internal_info) << "configuring Core" << endl;
    180183        this->setConfigValues();
     
    198201        // creates the class hierarchy for all classes with factories
    199202        orxout(internal_info) << "creating class hierarchy" << endl;
    200         Identifier::createClassHierarchy();
     203        IdentifierManager::getInstance().createClassHierarchy();
    201204
    202205        // Load OGRE excluding the renderer and the render window
     
    248251        safeObjectDelete(&configFileManager_);
    249252        ConsoleCommand::destroyAll();
    250         Identifier::destroyAllIdentifiers();
     253        Context::setRootContext(NULL);
     254        IdentifierManager::getInstance().destroyAllIdentifiers();
    251255        safeObjectDelete(&signalHandler_);
    252256        safeObjectDelete(&dynLibManager_);
     
    508512
    509513
     514    RegisterAbstractClass(DevModeListener).inheritsFrom(Class(Listable));
     515
    510516    DevModeListener::DevModeListener()
    511517    {
    512         RegisterRootObject(DevModeListener);
     518        RegisterObject(DevModeListener);
    513519    }
    514520}
  • code/trunk/src/libraries/core/Core.h

    r8858 r9667  
    4747#include "util/DestructionHelper.h"
    4848#include "util/Singleton.h"
    49 #include "OrxonoxClass.h"
     49#include "config/Configurable.h"
    5050
    5151namespace orxonox
    5252{
    5353    //! Informs about changes in the Development Mode.
    54     class DevModeListener : virtual public OrxonoxClass
     54    class DevModeListener : virtual public Listable
    5555    {
    5656    public:
     
    6666        You should only create this singleton once because it destroys the identifiers!
    6767    */
    68     class _CoreExport Core : public Singleton<Core>, public OrxonoxClass
     68    class _CoreExport Core : public Singleton<Core>, public Configurable
    6969    {
    7070        friend class Singleton<Core>;
  • code/trunk/src/libraries/core/CoreIncludes.h

    r8858 r9667  
    2828
    2929/**
    30     @defgroup Factory RegisterObject() and CreateFactory()
     30    @defgroup Factory RegisterObject() and RegisterClass()
    3131    @ingroup Object
    3232*/
     
    3535    @file
    3636    @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.
    4648
    4749    Example:
    4850    @code
    49     // Create the factory for MyClass
    50     CreateFactory(MyClass);
     51    // register MyClass
     52    RegisterClass(MyClass);
    5153
    5254    // Constructor:
     
    7981
    8082#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)) \
    93135        return; \
    94136    else \
     
    96138
    97139/**
    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 class
    100 */
    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 class
    107 
    108     In contrast to RegisterObject, this is used for classes that inherit directly from
    109     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 class
    117 */
    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 class
    124 */
    125 #define CreateUnloadableFactory(ClassName) \
    126     Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName, false)
    127 
    128 /**
    129140    @brief Returns the Identifier of the given class.
    130141    @param ClassName The name of the class
     
    137148{
    138149    /**
     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    /**
    139175        @brief Returns the Identifier with a given name.
    140176        @param name The name of the class
     
    142178    inline Identifier* ClassByString(const std::string& name)
    143179    {
    144         return Identifier::getIdentifierByString(name);
     180        return IdentifierManager::getInstance().getIdentifierByString(name);
    145181    }
    146182
     
    151187    inline Identifier* ClassByLowercaseString(const std::string& name)
    152188    {
    153         return Identifier::getIdentifierByLowercaseString(name);
     189        return IdentifierManager::getInstance().getIdentifierByLowercaseString(name);
    154190    }
    155191
     
    160196    inline Identifier* ClassByID(uint32_t id)
    161197    {
    162         return Identifier::getIdentifierByID(id);
     198        return IdentifierManager::getInstance().getIdentifierByID(id);
    163199    }
    164200
    165201    /**
    166202        @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.
    168204              The only use is in conjunction with macros that don't know the class type.
    169         @param object Pointer to an OrxonoxClass
     205        @param object Pointer to an Identifiable
    170206    */
    171207    template <class T>
  • code/trunk/src/libraries/core/CorePrereqs.h

    r8351 r9667  
    127127    class ClassFactory;
    128128    template <class T>
     129    class ClassFactoryWithContext;
     130    template <class T>
    129131    class ClassIdentifier;
    130132    class ClassTreeMask;
     
    140142    class ConfigFileManager;
    141143    class ConfigFileSection;
     144    class Configurable;
    142145    class ConfigValueContainer;
     146    class Context;
    143147    class Core;
     148    class Destroyable;
    144149    class DestructionListener;
    145150    class DynLib;
     
    154159    class GraphicsManager;
    155160    class GUIManager;
     161    class Identifiable;
    156162    class Identifier;
    157163    template <class T>
    158164    class Iterator;
    159165    class Language;
     166    class Listable;
    160167    class LuaFunctor;
    161168    class LuaState;
    162169    class MemoryArchive;
    163170    class MemoryArchiveFactory;
    164     class MetaObjectList;
    165     class MetaObjectListElement;
    166171    class Namespace;
    167172    class NamespaceNode;
     
    176181    class OgreWindowEventListener;
    177182    class OrxonoxClass;
     183    class OrxonoxInterface;
    178184    class PathConfig;
    179185    struct ResourceInfo;
  • code/trunk/src/libraries/core/Event.cc

    r8858 r9667  
    3535
    3636#include "BaseObject.h"
    37 #include "Identifier.h"
     37#include "class/Identifier.h"
    3838
    3939namespace orxonox
  • code/trunk/src/libraries/core/GUIManager.cc

    r9576 r9667  
    7878#include "util/OrxAssert.h"
    7979#include "util/output/BaseWriter.h"
    80 #include "ConfigValueIncludes.h"
     80#include "config/ConfigValueIncludes.h"
    8181#include "Core.h"
    8282#include "CoreIncludes.h"
     
    256256        , destructionHelper_(this)
    257257    {
    258         RegisterRootObject(GUIManager);
     258        RegisterObject(GUIManager);
    259259
    260260        orxout(internal_status) << "initializing GUIManager..." << endl;
  • code/trunk/src/libraries/core/GUIManager.h

    r8862 r9667  
    4949#include "util/Singleton.h"
    5050#include "input/InputHandler.h"
    51 #include "OrxonoxClass.h"
    5251#include "WindowEventListener.h"
    5352
  • code/trunk/src/libraries/core/Game.cc

    r8861 r9667  
    4444#include "util/Sleep.h"
    4545#include "util/SubString.h"
    46 #include "CommandLineParser.h"
    4746#include "Core.h"
    4847#include "CoreIncludes.h"
    49 #include "ConfigValueIncludes.h"
     48#include "config/CommandLineParser.h"
     49#include "config/ConfigValueIncludes.h"
    5050#include "GameMode.h"
    5151#include "GameState.h"
     
    112112
    113113        // Do this after the Core creation!
    114         RegisterRootObject(Game);
     114        RegisterObject(Game);
    115115        this->setConfigValues();
    116116
  • code/trunk/src/libraries/core/Game.h

    r8858 r9667  
    5050#include "util/DestructionHelper.h"
    5151#include "util/Singleton.h"
    52 #include "OrxonoxClass.h"
     52#include "config/Configurable.h"
    5353
    5454/**
     
    8282    class _CoreExport Game
    8383// tolua_end
    84         : public Singleton<Game>, public OrxonoxClass
     84        : public Singleton<Game>, public Configurable
    8585    { // tolua_export
    8686        friend class Singleton<Game>;
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r8861 r9667  
    5252#include "util/StringUtils.h"
    5353#include "util/SubString.h"
    54 #include "ConfigValueIncludes.h"
     54#include "config/ConfigValueIncludes.h"
    5555#include "CoreIncludes.h"
    5656#include "Core.h"
  • code/trunk/src/libraries/core/GraphicsManager.h

    r8858 r9667  
    5252#include "util/DestructionHelper.h"
    5353#include "util/Singleton.h"
    54 #include "OrxonoxClass.h"
     54#include "config/Configurable.h"
    5555
    5656// tolua_begin
     
    6363    class _CoreExport GraphicsManager
    6464// tolua_end
    65         : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
     65        : public Singleton<GraphicsManager>, public Configurable, public Ogre::LogListener
    6666    { // tolua_export
    6767        friend class Singleton<GraphicsManager>;
  • code/trunk/src/libraries/core/Loader.cc

    r8858 r9667  
    3737#include "util/StringUtils.h"
    3838#include "BaseObject.h"
    39 #include "Iterator.h"
    40 #include "ObjectList.h"
    4139#include "LuaState.h"
    4240#include "Namespace.h"
    4341#include "Resource.h"
    4442#include "XMLFile.h"
     43#include "object/Iterator.h"
     44#include "object/ObjectList.h"
    4545
    4646namespace orxonox
     
    209209
    210210            orxout(verbose, context::loader) << "  creating root-namespace..." << endl;
    211             Namespace* rootNamespace = new Namespace(0);
     211            Namespace* rootNamespace = new Namespace(Context::getRootContext());
    212212            rootNamespace->setLoaderIndentation("    ");
    213213            rootNamespace->setFile(file);
  • code/trunk/src/libraries/core/Namespace.cc

    r7401 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(Namespace);
     40    RegisterClass(Namespace);
    4141
    42     Namespace::Namespace(BaseObject* creator) : BaseObject(creator),
     42    Namespace::Namespace(Context* context) : BaseObject(context), Context(context),
    4343      bAutogeneratedFileRootNamespace_(false),
    4444      bRoot_(false),
  • code/trunk/src/libraries/core/Namespace.h

    r7401 r9667  
    4040#include <string>
    4141#include "BaseObject.h"
     42#include "object/Context.h"
    4243
    4344namespace orxonox
    4445{
    45     class Namespace : public BaseObject
     46    class Namespace : public BaseObject, public Context
    4647    {
    4748        public:
    48             Namespace(BaseObject* creator);
     49            Namespace(Context* context);
    4950            virtual ~Namespace();
    5051
  • code/trunk/src/libraries/core/PathConfig.cc

    r9550 r9667  
    5353#include "util/Output.h"
    5454#include "util/Exception.h"
    55 #include "CommandLineParser.h"
     55#include "config/CommandLineParser.h"
    5656
    5757// Differentiate Boost Filesystem v2 and v3
  • code/trunk/src/libraries/core/Template.cc

    r9348 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(Template);
     40    RegisterClass(Template);
    4141
    42     Template::Template(BaseObject* creator) : BaseObject(creator)
     42    Template::Template(Context* context) : BaseObject(context)
    4343    {
    4444        this->xmlelement_ = new TiXmlElement("");
     
    150150
    151151        // 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());
    153153        if (!object->getIdentifier()->isA(identifier))
    154154            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  
    5151    {
    5252        public:
    53             Template(BaseObject* creator);
     53            Template(Context* context);
    5454            virtual ~Template();
    5555
  • code/trunk/src/libraries/core/ViewportEventListener.cc

    r8079 r9667  
    3232namespace orxonox
    3333{
     34    RegisterAbstractClass(ViewportEventListener).inheritsFrom(Class(Listable));
     35
    3436    ViewportEventListener::ViewportEventListener()
    3537    {
    36         RegisterRootObject(ViewportEventListener);
     38        RegisterObject(ViewportEventListener);
    3739    }
    3840}
  • code/trunk/src/libraries/core/ViewportEventListener.h

    r8729 r9667  
    3333
    3434#include "util/OgreForwardRefs.h"
    35 #include "OrxonoxClass.h"
     35#include "object/Listable.h"
    3636
    3737namespace orxonox
    3838{
    39     class _CoreExport ViewportEventListener : virtual public OrxonoxClass
     39    class _CoreExport ViewportEventListener : virtual public Listable
    4040    {
    4141        public:
  • code/trunk/src/libraries/core/WindowEventListener.cc

    r7874 r9667  
    3535    unsigned int WindowEventListener::windowHeight_s = 0;
    3636
     37    RegisterAbstractClass(WindowEventListener).inheritsFrom(Class(Listable));
     38
    3739    WindowEventListener::WindowEventListener()
    3840    {
    39         RegisterRootObject(WindowEventListener);
     41        RegisterObject(WindowEventListener);
    4042    }
    4143
  • code/trunk/src/libraries/core/WindowEventListener.h

    r7874 r9667  
    3636
    3737#include "CorePrereqs.h"
    38 #include "OrxonoxClass.h"
     38#include "object/Listable.h"
    3939
    4040namespace orxonox
    4141{
    4242    //! Interface for receiving window events like resize, moved and focusChanged
    43     class _CoreExport WindowEventListener : virtual public OrxonoxClass
     43    class _CoreExport WindowEventListener : virtual public Listable
    4444    {
    4545        friend class OgreWindowEventListener;
  • code/trunk/src/libraries/core/XMLNameListener.cc

    r5781 r9667  
    3232namespace orxonox
    3333{
     34    RegisterAbstractClass(XMLNameListener).inheritsFrom(Class(Listable));
     35
    3436    XMLNameListener::XMLNameListener()
    3537    {
    36         RegisterRootObject(XMLNameListener);
     38        RegisterObject(XMLNameListener);
    3739    }
    3840}
  • code/trunk/src/libraries/core/XMLNameListener.h

    r7401 r9667  
    3636
    3737#include "CorePrereqs.h"
    38 #include "OrxonoxClass.h"
     38#include "object/Listable.h"
    3939
    4040namespace orxonox
    4141{
    42     class _CoreExport XMLNameListener : virtual public OrxonoxClass
     42    class _CoreExport XMLNameListener : virtual public Listable
    4343    {
    4444        public:
  • code/trunk/src/libraries/core/XMLPort.cc

    r8858 r9667  
    2929#include "XMLPort.h"
    3030
     31#include "CoreIncludes.h"
    3132#include "Loader.h"
    3233#include "Namespace.h"
     
    5960                for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
    6061                {
    61                     Identifier* identifier = Identifier::getIdentifierByString(child->Value());
     62                    Identifier* identifier = ClassByString(child->Value());
    6263                    if (!identifier)
    6364                    {
     
    8990                        orxout(verbose, context::xml) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << endl;
    9091
    91                         BaseObject* newObject = identifier->fabricate(object);
     92                        BaseObject* newObject = orxonox_cast<BaseObject*>(identifier->fabricate(object->getContext()));
    9293                        newObject->setLoaderIndentation(object->getLoaderIndentation() + "  ");
    9394
  • code/trunk/src/libraries/core/XMLPort.h

    r9348 r9667  
    5858#include "util/OrxAssert.h"
    5959#include "util/StringUtils.h"
    60 #include "Identifier.h"
     60#include "class/Identifier.h"
    6161#include "BaseObject.h"
    6262#include "command/Executor.h"
  • code/trunk/src/libraries/core/class/CMakeLists.txt

    r9577 r9667  
    33  Identifier.cc
    44  IdentifierManager.cc
     5  OrxonoxClass.cc
     6  OrxonoxInterface.cc
    57)
  • code/trunk/src/libraries/core/class/Identifiable.cc

    r9574 r9667  
    3535
    3636#include <cassert>
     37#include "core/CoreIncludes.h"
    3738#include "core/object/Context.h"
    3839#include "Identifier.h"
     
    4041namespace orxonox
    4142{
     43    RegisterClassNoArgs(Identifiable);
     44
    4245    /**
    4346        @brief Constructor: Sets the default values.
     
    4649    {
    4750        this->identifier_ = 0;
    48         this->parents_ = 0;
    49         // Optimisation
    50         this->objectPointers_.reserve(6);
    51     }
     51        this->objectPointers_.reserve(6); // Optimisation
    5252
    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);
    6154    }
    6255
  • code/trunk/src/libraries/core/class/Identifiable.h

    r9574 r9667  
    5555        public:
    5656            Identifiable();
    57             virtual ~Identifiable();
     57            virtual ~Identifiable() {}
    5858
    5959            /// Returns the Identifier of the object.
     
    119119        private:
    120120            Identifier* identifier_;               //!< The Identifier of the object
    121             std::set<const Identifier*>* parents_; //!< List of all parents of the object
    122121
    123122            /// 'Fast map' that holds this-pointers of all derived types
  • code/trunk/src/libraries/core/class/Identifier.cc

    r9593 r9667  
    3737
    3838#include "util/StringUtils.h"
     39#include "core/CoreIncludes.h"
    3940#include "core/config/ConfigValueContainer.h"
    4041#include "core/XMLPort.h"
     
    5051    */
    5152    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    {
    5855        this->factory_ = 0;
     56        this->bInitialized_ = false;
    5957        this->bLoadable_ = false;
    6058
     
    7068    Identifier::~Identifier()
    7169    {
    72         delete this->objects_;
    73 
    7470        if (this->factory_)
    7571            delete this->factory_;
     
    8480
    8581    /**
    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 class
    88         @param bRootClass True if the class is either an Interface or the BaseObject itself
    89     */
    90     void Identifier::initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass)
    91     {
    92         // Check if at least one object of the given type was created
    93         if (!this->bCreatedOneObject_ && IdentifierManager::isCreatingHierarchy())
    94         {
    95             // If no: We have to store the information and initialize the Identifier
    96             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             else
    100                 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 parents
    107     */
    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 parents
    119             for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
    120             {
    121                 // Tell the parent we're one of it's children
    122                 (*it)->children_.insert((*it)->children_.end(), this);
    123 
    124                 // Erase all parents of our parent from our direct-parent-list
    125                 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-list
    128                     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 it
    133                             this->directParents_.erase(it2);
    134                             break;
    135                         }
    136                     }
    137                 }
    138             }
    139 
    140             // Now iterate through all direct parents
    141             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 children
    144                 (*it)->directChildren_.insert((*it)->directChildren_.end(), this);
    145 
    146                 // Create the super-function dependencies
    147                 (*it)->createSuperFunctionCaller();
    148             }
    149         }
    150     }
    151 
    152     /**
    15382        @brief Sets the name of the class.
    15483    */
    15584    void Identifier::setName(const std::string& name)
    15685    {
    157         if (!this->bSetName_)
     86        if (name != this->name_)
    15887        {
    15988            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
    166101
    167102    /**
     
    169104        @return The new object
    170105    */
    171     OrxonoxClass* Identifier::fabricate(BaseObject* creator)
     106    Identifiable* Identifier::fabricate(Context* context)
    172107    {
    173108        if (this->factory_)
    174109        {
    175             return this->factory_->fabricate(creator);
     110            return this->factory_->fabricate(context);
    176111        }
    177112        else
     
    190125    void Identifier::setNetworkID(uint32_t id)
    191126    {
    192 //        Identifier::getIDIdentifierMapIntern().erase(this->networkID_);
    193         IdentifierManager::getIDIdentifierMapIntern()[id] = this;
    194127        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;
    195227    }
    196228
  • code/trunk/src/libraries/core/class/Identifier.h

    r9593 r9667  
    5656    object->getIdentifier()->getName();                                         // returns "MyClass"
    5757
    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
    6759
    6860
     
    9082
    9183#include "util/Output.h"
    92 #include "core/object/MetaObjectList.h"
    9384#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"
    9589#include "IdentifierManager.h"
    9690#include "Super.h"
     
    112106        @note You can't directly create an Identifier, it's just the base-class of ClassIdentifier<T>.
    113107    */
    114     class _CoreExport Identifier
    115     {
    116         friend class IdentifierManager;
    117 
     108    class _CoreExport Identifier : public Destroyable
     109    {
    118110        public:
     111            Identifier();
     112            Identifier(const Identifier& identifier); // don't copy
     113            virtual ~Identifier();
     114
    119115            /// Returns the name of the class the Identifier belongs to.
    120116            inline const std::string& getName() const { return this->name_; }
    121117            void setName(const std::string& name);
    122118
     119            /// Returns the name of the class as it is returned by typeid(T).name()
     120            virtual const std::string& getTypeidName() = 0;
     121
    123122            /// Returns the network ID to identify a class through the network.
    124123            inline uint32_t getNetworkID() const { return this->networkID_; }
     
    128127            ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
    129128
    130             /// Returns the list of all existing objects of this class.
    131             inline ObjectListBase* getObjects() const { return this->objects_; }
    132 
    133129            /// Sets the Factory.
    134             inline void addFactory(Factory* factory) { this->factory_ = factory; }
     130            void setFactory(Factory* factory);
    135131            /// Returns true if the Identifier has a Factory.
    136132            inline bool hasFactory() const { return (this->factory_ != 0); }
    137133
    138             OrxonoxClass* fabricate(BaseObject* creator);
     134            Identifiable* fabricate(Context* context);
    139135
    140136            /// Returns true if the class can be loaded through XML.
     
    142138            /// Set the class to be loadable through XML or not.
    143139            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();
    144153
    145154            bool isA(const Identifier* identifier) const;
     
    150159            bool isDirectParentOf(const Identifier* identifier) const;
    151160
    152 
    153             /////////////////////////////
    154             ////// Class Hierarchy //////
    155             /////////////////////////////
    156161            /// Returns the parents of the class the Identifier belongs to.
    157162            inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
     
    220225
    221226        protected:
    222             Identifier();
    223             Identifier(const Identifier& identifier); // don't copy
    224             virtual ~Identifier();
    225 
    226227            virtual void createSuperFunctionCaller() const = 0;
    227228
    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 class
    236 
    237229        private:
    238             void initialize(std::set<const Identifier*>* parents);
    239 
    240230            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 to
     231            std::set<const Identifier*> children_;                         //!< The children of the class the Identifier belongs to
    242232
    243233            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
    248237            bool bLoadable_;                                               //!< False = it's not permitted to load the object through XML
    249238            std::string name_;                                             //!< The name of the class the Identifier belongs to
     
    287276            static ClassIdentifier<T>* getIdentifier(const std::string& name);
    288277
    289             bool initialiseObject(T* object, const std::string& className, bool bRootClass);
     278            bool initializeObject(T* object);
    290279
    291280            void setConfigValues(T* object, Configurable*) const;
     
    295284            void addObjectToList(T* object, Identifiable*);
    296285
    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_; }
    298290
    299291        private:
    300             static void initialiseIdentifier();
     292            static void initializeIdentifier();
     293
    301294            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
    302295            ClassIdentifier()
    303296            {
     297                this->typeidName_ = typeid(T).name();
    304298                SuperFunctionInitialization<0, T>::initialize(this);
    305299            }
     
    309303            }
    310304
    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;
    312310    };
    313311
    314312    template <class T>
    315     ClassIdentifier<T>* ClassIdentifier<T>::classIdentifier_s = 0;
     313    WeakPtr<ClassIdentifier<T> > ClassIdentifier<T>::classIdentifier_s;
    316314
    317315    /**
     
    324322        // check if the Identifier already exists
    325323        if (!ClassIdentifier<T>::classIdentifier_s)
    326             ClassIdentifier<T>::initialiseIdentifier();
     324            ClassIdentifier<T>::initializeIdentifier();
    327325
    328326        return ClassIdentifier<T>::classIdentifier_s;
     
    346344    */
    347345    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.
    354349        ClassIdentifier<T>* proposal = new ClassIdentifier<T>();
    355350
    356351        // Get the entry from the map
    357         ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getIdentifierSingleton(name, proposal);
     352        ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getInstance().getGloballyUniqueIdentifier(proposal);
    358353
    359354        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;
    363356        else
    364357        {
    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)
    366360        }
    367361    }
     
    370364        @brief Adds an object of the given type to the ObjectList.
    371365        @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;
    382371
    383372        object->identifier_ = this;
    384         if (IdentifierManager::isCreatingHierarchy())
     373        if (IdentifierManager::getInstance().isCreatingHierarchy())
    385374        {
    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);
    394376
    395377            this->setConfigValues(object, object);
     
    425407     */
    426408    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);
    431413    }
    432414
     
    442424    template <class T>
    443425    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
    444432    {
    445433        if (!this->hasConfigValues())
     
    452440            for (std::set<const Identifier*>::const_iterator it = this->getChildrenBegin(); it != this->getChildrenEnd(); ++it)
    453441                (*it)->updateConfigValues(false);
     442    }
     443
     444    template <class T>
     445    void ClassIdentifier<T>::updateConfigValues(bool updateChildren, Identifiable*) const
     446    {
     447        // no action
    454448    }
    455449
  • code/trunk/src/libraries/core/class/IdentifierManager.cc

    r9564 r9667  
    3737
    3838#include "util/StringUtils.h"
     39#include "core/CoreIncludes.h"
    3940#include "core/config/ConfigValueContainer.h"
    4041#include "core/XMLPort.h"
     
    4344namespace orxonox
    4445{
    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;
    5556    }
    5657
    5758    /**
    5859        @brief Returns an identifier by name and adds it if not available
    59         @param name The name of the identifier as typeid().name() suggests
    6060        @param proposal A pointer to a newly created identifier for the case of non existence in the map
    6161        @return The identifier (unique instance)
    6262    */
    63     Identifier* IdentifierManager::getIdentifierSingleton(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 proposal
    70             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
    7171            return it->second;
    7272        }
     
    7474        {
    7575            // There is no entry: put the proposal into the map and return it
    76             getTypeIDIdentifierMap()[name] = proposal;
     76            this->identifierByTypeidName_[typeidName] = proposal;
    7777            return proposal;
    7878        }
     
    8080
    8181    /**
     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    /**
    8298        @brief Creates the class-hierarchy by creating and destroying one object of each type.
    8399    */
     
    85101    {
    86102        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)
    92115            {
    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);
    95132            }
    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();
    98149        orxout(internal_status) << "Finished class-hierarchy creation" << endl;
    99150    }
     
    104155    void IdentifierManager::destroyAllIdentifiers()
    105156    {
    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)
    107158            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;
    138175    }
    139176
     
    145182    Identifier* IdentifierManager::getIdentifierByString(const std::string& name)
    146183    {
    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())
    149186            return it->second;
    150187        else
     
    159196    Identifier* IdentifierManager::getIdentifierByLowercaseString(const std::string& name)
    160197    {
    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())
    163200            return it->second;
    164201        else
     
    173210    Identifier* IdentifierManager::getIdentifierByID(const uint32_t id)
    174211    {
    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())
    177214            return it->second;
    178215        else
     
    185222    void IdentifierManager::clearNetworkIDs()
    186223    {
    187         IdentifierManager::getIDIdentifierMapIntern().clear();
     224        this->identifierByNetworkId_.clear();
    188225    }
    189226}
  • code/trunk/src/libraries/core/class/IdentifierManager.h

    r9564 r9667  
    3838
    3939#include <map>
     40#include <set>
    4041#include <string>
    4142
     
    4445    class _CoreExport IdentifierManager
    4546    {
    46         friend class Identifier;
    47         template <class T> friend class ClassIdentifier;
     47        public:
     48            static IdentifierManager& getInstance();
    4849
    49         public:
     50            Identifier* getGloballyUniqueIdentifier(Identifier* proposal);
     51            void addIdentifierToLookupMaps(Identifier* identifier);
     52
     53            unsigned int getUniqueClassId()
     54                { return this->classIDCounter_s++; }
     55
     56
    5057            /////////////////////////////
    5158            ////// Class Hierarchy //////
    5259            /////////////////////////////
    53             static void createClassHierarchy();
     60            void createClassHierarchy();
     61            void destroyAllIdentifiers();
     62
     63            void createdObject(Identifiable* identifiable);
    5464
    5565            /// Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.
    56             inline static bool isCreatingHierarchy()
     66            inline bool isCreatingHierarchy()
    5767                { return (hierarchyCreatingCounter_s > 0); }
    5868
     
    6171            ///// Identifier Map /////
    6272            //////////////////////////
    63             static void destroyAllIdentifiers();
     73            Identifier* getIdentifierByString(const std::string& name);
     74            Identifier* getIdentifierByLowercaseString(const std::string& name);
     75            Identifier* getIdentifierByID(uint32_t id);
    6476
    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();
    7078
    7179            /// 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_; }
    8182            /// 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_; }
    9185            /// 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_; }
    11088
    11189        private:
     90            IdentifierManager();
     91            IdentifierManager(const IdentifierManager&);
     92            ~IdentifierManager() {}
     93
    11294            /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
    113             inline static void startCreatingHierarchy()
     95            inline void startCreatingHierarchy()
    11496                { hierarchyCreatingCounter_s++; }
    11597            /// Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.
    116             inline static void stopCreatingHierarchy()
     98            inline void stopCreatingHierarchy()
    11799                { hierarchyCreatingCounter_s--; }
    118100
    119             static 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.
    120102
    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
    123110    };
    124111}
  • code/trunk/src/libraries/core/class/OrxonoxClass.h

    r9585 r9667  
    5050    /**
    5151        @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.
    5452    */
    5553    class _CoreExport OrxonoxClass : virtual public Configurable, virtual public Destroyable
    5654    {
     55        public:
     56            OrxonoxClass();
    5757    };
    5858}
  • code/trunk/src/libraries/core/class/OrxonoxInterface.h

    r9585 r9667  
    5050    class _CoreExport OrxonoxInterface : virtual public Configurable, virtual public Destroyable
    5151    {
     52        public:
     53            OrxonoxInterface();
    5254    };
    5355}
  • code/trunk/src/libraries/core/class/SubclassIdentifier.h

    r9563 r9667  
    163163
    164164            /// 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) const
    166             {
    167                 OrxonoxClass* newObject = this->identifier_->fabricate(creator);
     165            T* fabricate(Context* context) const
     166            {
     167                Identifiable* newObject = this->identifier_->fabricate(context);
    168168
    169169                // Check if the creation was successful
  • code/trunk/src/libraries/core/class/Super.h

    r9568 r9667  
    103103            { \
    104104                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
    105                 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it) \
     105                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \
    106106                { \
    107107                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
     
    171171
    172172                // Iterate through all children
    173                 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
     173                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it)
    174174                {
    175175                    // Check if the caller is a fallback-caller
  • code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r8858 r9667  
    3939#include "util/Convert.h"
    4040#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"
    4444#include "CommandExecutor.h"
    4545#include "ConsoleCommand.h"
  • code/trunk/src/libraries/core/command/Functor.h

    r9550 r9667  
    120120#include "util/Output.h"
    121121#include "util/MultiType.h"
    122 #include "core/OrxonoxClass.h"
     122#include "core/object/Destroyable.h"
    123123#include "FunctorPtr.h"
    124124
     
    303303            /// Casts the object and registers as destruction listener.
    304304            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); } }
    306306            /// Casts the object and unregisters as destruction listener.
    307307            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.
    311311            inline void objectDeleted()
    312312                { this->object_ = 0; }
  • code/trunk/src/libraries/core/command/IOConsolePOSIX.cc

    r9550 r9667  
    9999
    100100        resetTerminalMode();
    101         this->shell_->destroy();
     101        delete this->shell_;
    102102
    103103        // Restore this->cout_ redirection
  • code/trunk/src/libraries/core/command/IOConsoleWindows.cc

    r9550 r9667  
    113113
    114114        resetTerminalMode();
    115         this->shell_->destroy();
     115        delete this->shell_;
    116116    }
    117117
  • code/trunk/src/libraries/core/command/Shell.cc

    r9550 r9667  
    4040#include "util/output/MemoryWriter.h"
    4141#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"
    4444#include "core/PathConfig.h"
    4545#include "core/input/InputBuffer.h"
     
    5555        const OutputLevel User = level::user_info;
    5656    }
     57
     58    RegisterClassNoArgs(Shell);
    5759
    5860    /**
     
    6668        , bScrollable_(bScrollable)
    6769    {
    68         RegisterRootObject(Shell);
     70        RegisterObject(Shell);
    6971
    7072        OutputManager::getInstance().registerListener(this);
     
    9698    Shell::~Shell()
    9799    {
    98         this->inputBuffer_->destroy();
     100        delete this->inputBuffer_;
    99101
    100102        OutputManager::getInstance().unregisterListener(this);
  • code/trunk/src/libraries/core/command/Shell.h

    r8858 r9667  
    5050#include "util/output/BaseWriter.h"
    5151#include "core/Core.h"
    52 #include "core/OrxonoxClass.h"
    5352
    5453namespace orxonox
     
    110109            };
    111110
    112             Shell(const std::string& consoleName, bool bScrollable);
     111            Shell(const std::string& consoleName = "", bool bScrollable = true);
    113112            ~Shell();
    114113
     
    200199            unsigned int              historyOffset_;       ///< The command history is a circular buffer, this variable defines the current write-offset
    201200            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 OrxonoxClass
     201            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
    203202    };
    204203}
  • code/trunk/src/libraries/core/config/CMakeLists.txt

    r9560 r9667  
    66  ConfigFileManager.cc
    77  ConfigFileSection.cc
     8  Configurable.cc
    89  ConfigValueContainer.cc
    910  SettingsConfigFile.cc
  • code/trunk/src/libraries/core/config/ConfigValueContainer.h

    r9564 r9667  
    7070            inline virtual void call(void* object)
    7171            {
    72                 if (!IdentifierManager::isCreatingHierarchy())
     72                if (!IdentifierManager::getInstance().isCreatingHierarchy())
    7373                    (static_cast<T*>(object)->*this->function_)();
    7474            }
  • code/trunk/src/libraries/core/config/Configurable.h

    r9577 r9667  
    4848    {
    4949        public:
     50            Configurable();
     51
    5052            /// Function to collect the SetConfigValue-macro calls.
    5153            void setConfigValues() {};
  • code/trunk/src/libraries/core/input/Button.cc

    r8858 r9667  
    4242#include "core/command/CommandEvaluation.h"
    4343#include "core/command/CommandExecutor.h"
    44 #include "core/ConfigFileManager.h"
     44#include "core/config/ConfigFile.h"
    4545
    4646namespace orxonox
  • code/trunk/src/libraries/core/input/InputBuffer.cc

    r6417 r9667  
    3131#include "util/Clipboard.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/ConfigValueIncludes.h"
     33#include "core/config/ConfigValueIncludes.h"
    3434
    3535namespace orxonox
    3636{
     37    RegisterClassNoArgs(InputBuffer);
     38
    3739    InputBuffer::InputBuffer()
    3840    {
    39         RegisterRootObject(InputBuffer);
     41        RegisterObject(InputBuffer);
    4042
    4143        this->cursor_ = 0;
     
    5759    InputBuffer::InputBuffer(const std::string& allowedChars)
    5860    {
    59         RegisterRootObject(InputBuffer);
     61        RegisterObject(InputBuffer);
    6062
    6163        this->maxLength_ = 1024;
  • code/trunk/src/libraries/core/input/InputBuffer.h

    r6417 r9667  
    3434#include <list>
    3535#include <string>
    36 #include "core/OrxonoxClass.h"
     36#include "core/config/Configurable.h"
    3737#include "InputHandler.h"
    3838
     
    7474    };
    7575
    76     class _CoreExport InputBuffer : public InputHandler, public OrxonoxClass
     76    class _CoreExport InputBuffer : public InputHandler, public Configurable
    7777    {
    7878        public:
  • code/trunk/src/libraries/core/input/InputManager.cc

    r9550 r9667  
    4646#include "util/Exception.h"
    4747#include "core/CoreIncludes.h"
    48 #include "core/ConfigValueIncludes.h"
    49 #include "core/CommandLineParser.h"
    5048#include "core/GraphicsManager.h"
     49#include "core/config/ConfigValueIncludes.h"
     50#include "core/config/CommandLineParser.h"
    5151#include "core/command/ConsoleCommand.h"
    5252#include "core/command/Functor.h"
     
    9898        , calibratorCallbackHandler_(0)
    9999    {
    100         RegisterRootObject(InputManager);
     100        RegisterObject(InputManager);
    101101
    102102        orxout(internal_status, context::input) << "InputManager: Constructing..." << endl;
     
    280280        this->destroyState("calibrator");
    281281        // Destroy KeyDetector and state
    282         calibratorCallbackHandler_->destroy();
     282        delete calibratorCallbackHandler_;
    283283        // Destroy the empty InputState
    284284        this->destroyStateInternal(this->emptyState_);
     
    642642        assert(state && this->activeStates_.find(state->getPriority()) == this->activeStates_.end());
    643643        statesByName_.erase(state->getName());
    644         state->destroy();
     644        delete state;
    645645    }
    646646
  • code/trunk/src/libraries/core/input/JoyStick.cc

    r8858 r9667  
    3434
    3535#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"
    3839#include "core/CoreIncludes.h"
    3940#include "util/Convert.h"
     
    5051        : super(id, oisInputManager)
    5152    {
    52         RegisterRootObject(JoyStick);
     53        RegisterObject(JoyStick);
    5354        this->setConfigValues();
    5455        // Initialise POV and Slider states
  • code/trunk/src/libraries/core/input/JoyStick.h

    r8729 r9667  
    3636#include <ois/OISJoyStick.h>
    3737#include "InputDevice.h"
     38#include "core/config/Configurable.h"
    3839
    3940namespace orxonox
     
    5859    */
    5960    class _CoreExport JoyStick
    60         : public OrxonoxClass
     61        : public Configurable
    6162        , public InputDeviceTemplated<JoyStickTraits>
    6263        , public OIS::JoyStickListener
  • code/trunk/src/libraries/core/input/JoyStickQuantityListener.cc

    r5781 r9667  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ObjectList.h"
     32#include "core/object/ObjectList.h"
    3333
    3434namespace orxonox
  • code/trunk/src/libraries/core/input/JoyStickQuantityListener.h

    r8729 r9667  
    3838
    3939#include <vector>
    40 #include "core/OrxonoxClass.h"
     40#include "core/object/Listable.h"
    4141
    4242namespace orxonox
    4343{
    4444    //! Derive from this class to get informed when joy sticks get added/removed
    45     class _CoreExport JoyStickQuantityListener : virtual public OrxonoxClass
     45    class _CoreExport JoyStickQuantityListener : virtual public Listable
    4646    {
    4747        friend class InputManager;
  • code/trunk/src/libraries/core/input/KeyBinder.cc

    r8858 r9667  
    3434#include "util/Output.h"
    3535#include "util/Exception.h"
    36 #include "core/ConfigValueIncludes.h"
    3736#include "core/CoreIncludes.h"
    38 #include "core/ConfigFileManager.h"
     37#include "core/config/ConfigValueIncludes.h"
     38#include "core/config/ConfigFile.h"
    3939#include "core/PathConfig.h"
    4040#include "InputCommands.h"
     
    5858        mousePosition_[1] = 0.0;
    5959
    60         RegisterRootObject(KeyBinder);
     60        RegisterObject(KeyBinder);
    6161
    6262        // initialise all buttons and half axes to avoid creating everything with 'new'
  • code/trunk/src/libraries/core/input/KeyBinderManager.cc

    r8858 r9667  
    3232#include "util/Exception.h"
    3333#include "util/ScopedSingletonManager.h"
    34 #include "core/ConfigValueIncludes.h"
     34#include "core/config/ConfigValueIncludes.h"
    3535#include "core/CoreIncludes.h"
    3636#include "core/LuaState.h"
  • code/trunk/src/libraries/core/input/KeyBinderManager.h

    r8729 r9667  
    3636
    3737#include "util/Singleton.h"
    38 #include "core/OrxonoxClass.h"
     38#include "core/config/Configurable.h"
    3939
    4040namespace orxonox //tolua_export
     
    5353    */
    5454    class _CoreExport KeyBinderManager //tolua_export
    55         : public Singleton<KeyBinderManager>, public OrxonoxClass
     55        : public Singleton<KeyBinderManager>, public Configurable
    5656    { //tolua_export
    5757        friend class Singleton<KeyBinderManager>;
  • code/trunk/src/libraries/core/input/Mouse.cc

    r8729 r9667  
    5454        : super(id, oisInputManager)
    5555    {
    56         RegisterRootObject(Mouse);
     56        RegisterObject(Mouse);
    5757        this->windowResized(this->getWindowWidth(), this->getWindowHeight());
    5858
  • code/trunk/src/libraries/core/object/CMakeLists.txt

    r9591 r9667  
    33  Destroyable.cc
    44  Listable.cc
    5   MetaObjectList.cc
    65  ObjectListBase.cc
    76)
  • code/trunk/src/libraries/core/object/ClassFactory.h

    r9563 r9667  
    4343
    4444#include "util/Output.h"
    45 #include "core/class/Identifier.h"
    4645
    4746namespace orxonox
     
    5049    // ###       Factory       ###
    5150    // ###########################
    52     /// Base-class of ClassFactory.
     51    /// Base-class of all factories.
    5352    class _CoreExport Factory
    5453    {
    5554        public:
    56             virtual ~Factory() {};
    57             virtual OrxonoxClass* fabricate(BaseObject* creator) = 0;
     55            virtual ~Factory() {}
     56            virtual Identifiable* fabricate(Context* context) = 0;
    5857    };
    5958
     
    6160    // ###      ClassFactory       ###
    6261    // ###############################
    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
    6463    template <class T>
    6564    class ClassFactory : public Factory
    6665    {
     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    {
    6775        public:
    68             /**
    69                 @brief Constructor: Adds the ClassFactory to the Identifier of the same type.
    70                 @param name The name of the class
    71                 @param bLoadable True if the class can be loaded through XML
    72             */
    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 
    8076            /**
    8177                @brief Creates and returns a new object of class T.
    8278                @return The new object
    8379            */
    84             inline OrxonoxClass* fabricate(BaseObject* creator)
     80            inline Identifiable* fabricate(Context* context)
    8581            {
    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));
    87101            }
    88102    };
  • code/trunk/src/libraries/core/object/Context.cc

    r9591 r9667  
    3333
    3434#include "Context.h"
     35#include "core/class/Identifier.h"
     36#include "core/CoreIncludes.h"
    3537
    3638namespace orxonox
    3739{
    38     Context::Context(Context* context) : parentContext_(context)
     40    RegisterClass(Context);
     41
     42    Context* Context::rootContext_s = 0;
     43
     44    Context* getContextForInitializationOfOtherContexts()
    3945    {
     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);
    4066    }
    4167
    4268    Context::~Context()
    4369    {
     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;
    4481    }
    4582
    4683    /*static*/ Context* Context::getRootContext()
    4784    {
    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];
    5098    }
    5199}
  • code/trunk/src/libraries/core/object/Context.h

    r9591 r9667  
    3737#include "core/CorePrereqs.h"
    3838
     39#include <vector>
     40
     41#include "Listable.h"
     42
    3943namespace orxonox
    4044{
    41     class _CoreExport Context
     45    class _CoreExport Context : virtual public Listable
    4246    {
    4347        public:
     48            static void setRootContext(Context* context);
     49            static Context* getRootContext();
     50
    4451            Context(Context* context);
    4552            virtual ~Context();
     
    4855                { return this->parentContext_; }
    4956
    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            }
    5172
    5273        private:
    5374            Context* parentContext_;
     75            std::vector<ObjectListBase*> objectLists_;
     76
     77            static Context* rootContext_s;
    5478    };
    5579}
  • code/trunk/src/libraries/core/object/Iterator.h

    r9573 r9667  
    5656#include "core/CorePrereqs.h"
    5757
    58 #include "core/class/Identifier.h"
    5958#include "ObjectListBase.h"
     59#include "IteratorBase.h"
    6060
    6161namespace orxonox
     
    7070    */
    7171    template <class T>
    72     class Iterator
     72    class Iterator : public IteratorBase<T, Iterator<T> >
    7373    {
    7474        public:
     
    7676                @brief Constructor: Sets the element, whereon the iterator points, to zero.
    7777            */
    78             inline Iterator()
    79             {
    80                 this->element_ = 0;
    81                 this->list_ = 0;
    82             }
     78            inline Iterator() : IteratorBase<T, Iterator<T> >(NULL) {}
    8379
    8480            /**
    85                 @brief Constructor: Sets this element to the exported element.
    86                 @param exp The exported element
     81                @brief Constructor: Sets this element to a given element
     82                @param element The element
    8783            */
    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) {}
    9485
    9586            /**
     
    9788                @param other The other Iterator
    9889            */
    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) {}
    16991
    17092            /**
     
    17294                @param element The element
    17395            */
    174             template <class O>
    175             inline Iterator<T>& operator=(ObjectListElement<O>* element)
     96            inline Iterator<T>& operator=(ObjectListBaseElement* element)
    17697            {
    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);
    18499                return (*this);
    185             }
    186 
    187             /**
    188                 @brief Assigns the element of an ObjectListIterator.
    189                 @param other The ObjectListIterator
    190             */
    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 itself
    207             */
    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 itself
    217             */
    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 itself
    228             */
    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 itself
    238             */
    239             inline Iterator<T> operator--(int i)
    240             {
    241                 Iterator<T> copy = *this;
    242                 this->element_ = this->element_->prev_;
    243                 return copy;
    244100            }
    245101
     
    261117                return orxonox_cast<T*>(this->element_->objectBase_);
    262118            }
    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() const
    269             {
    270                 return (this->element_ != 0);
    271             }
    272 
    273             /**
    274                 @brief Overloading of the == operator to compare with another Iterator.
    275                 @param compare The other Iterator
    276                 @return True if the iterators point to the same element
    277             */
    278             inline bool operator==(const Iterator<T>& compare) const
    279             {
    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 Iterator
    286                 @return True if the iterators point to different elements
    287             */
    288             inline bool operator!=(const Iterator<T>& compare) const
    289             {
    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 with
    296             */
    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 at
    305             ObjectListBase* list_;                 //!< The list wherein the element is
    306119    };
    307120}
  • code/trunk/src/libraries/core/object/Listable.cc

    r9572 r9667  
    3333
    3434#include "Listable.h"
    35 
    36 #include "core/object/MetaObjectList.h"
     35#include "core/CoreIncludes.h"
     36#include "ObjectListBase.h"
     37#include "Context.h"
    3738
    3839namespace orxonox
    3940{
     41    RegisterClass(Listable);
     42
    4043    /**
    41         @brief Constructor: creates the meta-object-list.
     44        @brief Constructor: Allocates space in the element list.
    4245    */
    4346    Listable::Listable()
    4447    {
    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);
    4663    }
    4764
     
    5976    void Listable::unregisterObject()
    6077    {
    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);
    64112    }
    65113}
  • code/trunk/src/libraries/core/object/Listable.h

    r9572 r9667  
    3737
    3838#include "core/CorePrereqs.h"
     39
     40#include <vector>
     41
    3942#include "core/class/Identifiable.h"
    4043
     
    4245{
    4346    /**
    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.
    4548    */
    4649    class _CoreExport Listable : virtual public Identifiable
    4750    {
    48         template <class T>
    49         friend class ClassIdentifier;
     51        friend class Context;
    5052
    5153        public:
    5254            Listable();
     55            Listable(Context* context);
    5356            virtual ~Listable();
    5457
    5558            void unregisterObject();
    5659
     60            void setContext(Context* context);
     61            inline Context* getContext() const
     62                { return this->context_; }
     63
    5764        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
    5978    };
    6079}
  • code/trunk/src/libraries/core/object/ObjectList.h

    r9557 r9667  
    4949#include "ObjectListBase.h"
    5050#include "ObjectListIterator.h"
     51#include "Context.h"
    5152
    5253namespace orxonox
     
    6869            typedef ObjectListIterator<T> iterator;
    6970
     71            /// Returns the size of the list
     72            inline static size_t size()
     73            {
     74                return Context::getRootContext()->getObjectList<T>()->size();
     75            }
     76
    7077            /// Returns an Iterator to the first element in the list.
    7178            inline static ObjectListElement<T>* begin()
    7279            {
    73                 ObjectListBase* list = ClassIdentifier<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());
    7582            }
    7683
     
    7885            inline static ObjectListElement<T>* end()
    7986            {
    80                 ObjectListBase* list = ClassIdentifier<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());
    8289            }
    8390
     
    8592            inline static ObjectListElement<T>* rbegin()
    8693            {
    87                 ObjectListBase* list = ClassIdentifier<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());
    8996            }
    9097
     
    9299            inline static ObjectListElement<T>* rend()
    93100            {
    94                 ObjectListBase* list = ClassIdentifier<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());
    96103            }
    97104    };
  • code/trunk/src/libraries/core/object/ObjectListBase.cc

    r9593 r9667  
    4141namespace orxonox
    4242{
     43    // ###############################
     44    // ###  ObjectListBaseElement  ###
     45    // ###############################
     46    void ObjectListBaseElement::removeFromList()
     47    {
     48        if (this->list_)
     49            this->list_->removeElement(this);
     50    }
     51
     52    // ###############################
     53    // ###     ObjectListBase      ###
     54    // ###############################
    4355    /**
    4456        @brief Constructor: Sets default values.
     
    4860        this->first_ = 0;
    4961        this->last_ = 0;
     62        this->size_ = 0;
    5063    }
    5164
     
    5568    ObjectListBase::~ObjectListBase()
    5669    {
    57         ObjectListBaseElement* temp;
    58         while (this->first_)
     70        ObjectListBaseElement* current = this->first_;
     71        while (current)
    5972        {
    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;
    6380        }
    6481    }
    6582
    6683    /**
    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
    6987    */
    70     void ObjectListBase::notifyIterators(Listable* object) const
     88    void ObjectListBase::notifyRemovalListeners(ObjectListBaseElement* element) const
    7189    {
    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);
    7692    }
    7793
     
    7995        @brief Adds a new object to the end of the list.
    8096        @param element The element to add
    81         @return The pointer to the new ObjectListBaseElement, needed by the MetaObjectList of the added object
    8297    */
    83     ObjectListBaseElement* ObjectListBase::addElement(ObjectListBaseElement* element)
     98    void ObjectListBase::addElement(ObjectListBaseElement* element)
    8499    {
     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
    85109        if (!this->last_)
    86110        {
    87111            // If the list is empty
    88112            this->last_ = element;
    89             this->first_ = this->last_; // There's only one object in the list now
     113            this->first_ = element; // There's only one object in the list now
    90114        }
    91115        else
     
    94118            ObjectListBaseElement* temp = this->last_;
    95119            this->last_ = element;
    96             this->last_->prev_ = temp;
    97             temp->next_ = this->last_;
     120            element->prev_ = temp;
     121            temp->next_ = element;
    98122        }
    99123
    100         return this->last_;
     124        element->list_ = this;
     125        ++this->size_;
    101126    }
    102127
     128    /**
     129     * @brief Removes the element from the list
     130     */
    103131    void ObjectListBase::removeElement(ObjectListBaseElement* element)
    104132    {
    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);
    107142
    108143        if (element->next_)
     
    115150        else
    116151            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_;
    117157    }
    118158}
  • code/trunk/src/libraries/core/object/ObjectListBase.h

    r9593 r9667  
    4242#include "core/CorePrereqs.h"
    4343#include <vector>
     44#include "Context.h"
    4445
    4546namespace orxonox
     
    5657                @param objectBase The object to store
    5758            */
    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;
    5963
    6064            ObjectListBaseElement* next_;       //!< The next element in the list
    6165            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();
    6371    };
    6472
     
    7381        public:
    7482            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
    7595            T* object_;              //!< The object
    7696    };
    7797
     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    };
    78109
    79110    // ###############################
     
    97128            ~ObjectListBase();
    98129
    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);
    104131            void removeElement(ObjectListBaseElement* element);
    105132
    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_; }
    113134
    114135            /// 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_; }
    116137            /// 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; }
    118139            /// 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_; }
    120141            /// 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; }
    122143
    123             inline void registerIterator(void* iterator) { this->iterators_.push_back(iterator); }
    124             inline void unregisterIterator(void* iterator)
     144            inline void registerRemovalListener(ObjectListElementRemovalListener* listener) { this->listeners_.push_back(listener); }
     145            inline void unregisterRemovalListener(ObjectListElementRemovalListener* listener)
    125146            {
    126                 for (unsigned int i = 0; i < this->iterators_.size(); ++i)
     147                for (unsigned int i = 0; i < this->listeners_.size(); ++i)
    127148                {
    128                     if (iterators_[i] == iterator)
     149                    if (listeners_[i] == listener)
    129150                    {
    130                         iterators_.erase(iterators_.begin() + i);
     151                        listeners_.erase(listeners_.begin() + i);
    131152                        break;
    132153                    }
    133154                }
    134155            }
    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;
    148156
    149157        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
    154164    };
    155165}
  • code/trunk/src/libraries/core/object/ObjectListIterator.h

    r9573 r9667  
    5858#include "core/class/Identifier.h"
    5959#include "ObjectList.h"
     60#include "IteratorBase.h"
    6061
    6162namespace orxonox
     
    6768    */
    6869    template <class T>
    69     class ObjectListIterator
     70    class ObjectListIterator : public IteratorBase<T, ObjectListIterator<T> >
    7071    {
    71         template <class I>
    72         friend class Iterator;
    73 
    7472        public:
    7573            /**
    7674                @brief Constructor: Sets the element, whereon the ObjectListIterator points, to zero.
    7775            */
    78             inline ObjectListIterator()
    79             {
    80                 this->element_ = 0;
    81                 ClassIdentifier<T>::getIdentifier()->getObjects()->registerObjectListIterator(this);
    82             }
     76            inline ObjectListIterator() : IteratorBase<T, ObjectListIterator<T> >(NULL) {}
    8377
    8478            /**
     
    8680                @param element The element to start with
    8781            */
    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) {}
    9383
    9484            /**
     
    9686                @param other The other ObjectListIterator
    9787            */
    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) {}
    17389
    17490            /**
     
    17894            inline T* operator*() const
    17995            {
    180                 return this->element_->object_;
     96                return static_cast<ObjectListElement<T>*>(this->element_)->object_;
    18197            }
    18298
     
    187103            inline T* operator->() const
    188104            {
    189                 return this->element_->object_;
     105                return static_cast<ObjectListElement<T>*>(this->element_)->object_;
    190106            }
    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() const
    197             {
    198                 return (this->element_ != 0);
    199             }
    200 
    201             /**
    202                 @brief Overloading of the == operator to compare with another ObjectListIterator.
    203                 @param compare The other ObjectListIterator
    204                 @return True if the ObjectListIterator point to the same element
    205             */
    206             inline bool operator==(const ObjectListIterator<T>& compare) const
    207             {
    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 ObjectListIterator
    214                 @return True if the ObjectListIterator point to different elements
    215             */
    216             inline bool operator!=(const ObjectListIterator<T>& compare) const
    217             {
    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 with
    224             */
    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 at
    233107    };
    234108}
  • code/trunk/src/libraries/network/Client.cc

    r9550 r9667  
    5151#include "FunctionCallManager.h"
    5252#include "core/CoreIncludes.h"
    53 #include "core/CommandLineParser.h"
    5453#include "core/Game.h"
     54#include "core/config/CommandLineParser.h"
    5555
    5656namespace orxonox
  • code/trunk/src/libraries/network/ClientConnectionListener.cc

    r8327 r9667  
    3535namespace orxonox
    3636{
     37    RegisterAbstractClass(ClientConnectionListener).inheritsFrom(Class(Listable));
     38
    3739    ClientConnectionListener::ClientConnectionListener()
    3840    {
    39         RegisterRootObject(ClientConnectionListener);
     41        RegisterObject(ClientConnectionListener);
    4042    }
    4143
  • code/trunk/src/libraries/network/ClientConnectionListener.h

    r8327 r9667  
    3131
    3232#include "NetworkPrereqs.h"
    33 #include "core/OrxonoxClass.h"
     33#include "core/object/Listable.h"
    3434
    3535namespace orxonox
    3636{
    37     class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
     37    class _NetworkExport ClientConnectionListener : virtual public Listable
    3838    {
    3939        public:
  • code/trunk/src/libraries/network/Host.cc

    r8858 r9667  
    3333
    3434#include "core/CoreIncludes.h"
    35 #include "core/ObjectList.h"
     35#include "core/object/ObjectList.h"
    3636#include "core/command/ConsoleCommand.h"
    3737#include "NetworkChatListener.h"
     
    145145  NetworkChatListener::NetworkChatListener()
    146146  {
    147       RegisterRootObject(NetworkChatListener);
     147      RegisterObject(NetworkChatListener);
    148148  }
    149149
  • code/trunk/src/libraries/network/NetworkChatListener.h

    r8858 r9667  
    3232#include "NetworkPrereqs.h"
    3333
    34 #include "core/OrxonoxClass.h"
     34#include "core/object/Listable.h"
    3535
    3636namespace orxonox
     
    4343        in Host and ChatManager. ChatManager is the main derivative of this interface.
    4444    */
    45     class _NetworkExport NetworkChatListener : virtual public OrxonoxClass
     45    class _NetworkExport NetworkChatListener : virtual public Listable
    4646    {
    4747        friend class Host;
  • code/trunk/src/libraries/network/NetworkFunction.cc

    r7284 r9667  
    3737  std::map<uint32_t, NetworkMemberFunctionBase*> NetworkMemberFunctionBase::idMap_;
    3838
     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
    3944  NetworkFunctionBase::NetworkFunctionBase(const std::string& name)
    4045  {
    41     RegisterRootObject(NetworkFunctionBase);
     46      RegisterObject(NetworkFunctionBase);
    4247
    4348    static uint32_t networkID = 0;
     
    5762    std::map<std::string, NetworkFunctionBase*>::iterator it;
    5863    for( it=map.begin(); it!=map.end(); ++it )
    59       it->second->destroy();
     64      delete it->second;
    6065  }
    6166
  • code/trunk/src/libraries/network/NetworkFunction.h

    r8418 r9667  
    3939#include <boost/static_assert.hpp>
    4040
    41 #include "core/Identifier.h"
     41#include "core/object/Listable.h"
     42#include "core/class/Identifier.h"
    4243#include "core/command/Functor.h"
    4344#include "FunctionCallManager.h"
     
    7071
    7172
    72 class _NetworkExport NetworkFunctionBase: virtual public OrxonoxClass {
     73class _NetworkExport NetworkFunctionBase: virtual public Listable {
    7374  public:
    7475    NetworkFunctionBase(const std::string& name);
  • code/trunk/src/libraries/network/Server.cc

    r8858 r9667  
    4848#include "util/Clock.h"
    4949#include "util/Output.h"
    50 #include "core/ObjectList.h"
    5150#include "core/command/Executor.h"
    5251#include "packet/Chat.h"
  • code/trunk/src/libraries/network/TrafficControl.cc

    r8858 r9667  
    3333
    3434#include "core/CoreIncludes.h"
    35 #include "core/ConfigValueIncludes.h"
     35#include "core/config/ConfigValueIncludes.h"
    3636#include "synchronisable/Synchronisable.h"
    3737
  • code/trunk/src/libraries/network/WANDiscoverable.cc

    r8858 r9667  
    3333
    3434#include "MasterServerProtocol.h"
    35 #include "core/ConfigValueIncludes.h"
     35#include "core/config/ConfigValueIncludes.h"
    3636#include "core/CoreIncludes.h"
    3737
  • code/trunk/src/libraries/network/WANDiscoverable.h

    r8858 r9667  
    3030
    3131#include "NetworkPrereqs.h"
    32 #include "core/OrxonoxClass.h"
    33 #include "core/CoreIncludes.h"
     32#include "core/config/Configurable.h"
    3433#include "MasterServerComm.h"
    3534
     
    3736{
    3837
    39   class _NetworkExport WANDiscoverable: public OrxonoxClass
     38  class _NetworkExport WANDiscoverable: public Configurable
    4039  {
    4140    public:
  • code/trunk/src/libraries/network/WANDiscovery.h

    r8858 r9667  
    3131#include "NetworkPrereqs.h"
    3232#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"
    3735#include "MasterServerComm.h"
    3836#include "MasterServerProtocol.h"
     
    4846  class _NetworkExport WANDiscovery
    4947// tolua_end
    50     : public OrxonoxClass
     48    : public Configurable
    5149  { // tolua_export
    5250    public:
  • code/trunk/src/libraries/network/packet/ClassID.cc

    r8858 r9667  
    5555
    5656  //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){
    5959    id = it->second;
    6060    if(id == NULL || !id->hasFactory())
     
    129129
    130130  //clear the map of network ids
    131   Identifier::clearNetworkIDs();
     131  IdentifierManager::getInstance().clearNetworkIDs();
    132132
    133133  orxout(verbose, context::packets) << "=== processing classids: " << endl;
  • code/trunk/src/libraries/network/packet/FunctionIDs.cc

    r8858 r9667  
    3535
    3636#include "util/Output.h"
    37 #include "core/ObjectList.h"
     37#include "core/object/ObjectList.h"
    3838#include "network/NetworkFunction.h"
    3939
  • code/trunk/src/libraries/network/packet/Gamestate.cc

    r8952 r9667  
    3333#include "util/Output.h"
    3434#include "util/OrxAssert.h"
     35#include "core/CoreIncludes.h"
    3536#include "core/GameMode.h"
    36 #include "core/ObjectList.h"
     37#include "core/object/ObjectList.h"
    3738#include "network/synchronisable/Synchronisable.h"
    3839#include "network/GamestateHandler.h"
     
    132133    tempsize = it->getData(mem, this->sizes_, id, mode);
    133134    if ( tempsize != 0 )
    134       dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
     135      dataVector_.push_back( obj(it->getObjectID(), it->getContextID(), tempsize, mem-data_) );
    135136
    136137#ifndef NDEBUG
     
    468469    {
    469470      assert( objectHeader.getClassID() == htemp.getClassID() );
    470       assert( objectHeader.getCreatorID() == htemp.getCreatorID() );
     471      assert( objectHeader.getContextID() == htemp.getContextID() );
    471472      return true;
    472473    }
  • code/trunk/src/libraries/network/synchronisable/Serialise.h

    r8706 r9667  
    4141#include "util/Serialise.h"
    4242#include "core/CorePrereqs.h"
    43 #include "core/CoreIncludes.h"
    44 #include "core/BaseObject.h" // remove this if circular dependencies in BaseObject/SmartPtr are fixed
    45 //#include "core/SmartPtr.h"
    4643
    4744namespace orxonox{
  • code/trunk/src/libraries/network/synchronisable/Synchronisable.cc

    r8858 r9667  
    4545  uint8_t Synchronisable::state_=0x1; // detemines wheter we are server (default) or client
    4646
     47  RegisterAbstractClass(Synchronisable).inheritsFrom(Class(OrxonoxInterface));
     48
    4749  /**
    4850  * Constructor:
    4951  * Initializes all Variables and sets the right objectID_
    5052  */
    51   Synchronisable::Synchronisable(BaseObject* creator )
    52   {
    53     RegisterRootObject(Synchronisable);
     53  Synchronisable::Synchronisable(Context* context)
     54  {
     55      RegisterObject(Synchronisable);
    5456    static uint32_t idCounter=0;
    5557    objectMode_=0x1; // by default do not send data to server
     
    6971    this->setPriority( Priority::Normal );
    7072
    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);
    7675  }
    7776
     
    8382  {
    8483    // delete callback function objects
    85     if(!Identifier::isCreatingHierarchy()){
     84    if(!IdentifierManager::getInstance().isCreatingHierarchy()){
    8685      // remove object from the static objectMap
    8786      if (this->objectMode_ != 0x0 && (Host::running() && Host::isServer()))
     
    10099  }
    101100
     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  }
    102116
    103117  /**
     
    142156    }
    143157    assert(id);
    144     BaseObject* creator = 0;
    145     if (header.getCreatorID() != OBJECTID_UNKNOWN)
    146     {
    147       Synchronisable* synchronisable_creator = Synchronisable::getSynchronisable(header.getCreatorID());
    148       if (!synchronisable_creator)
     158    Context* context = 0;
     159    if (header.getContextID() != OBJECTID_UNKNOWN)
     160    {
     161      Synchronisable* synchronisable_context = Synchronisable::getSynchronisable(header.getContextID());
     162      if (!synchronisable_context)
    149163      {
    150164        mem += header.getDataSize()+SynchronisableHeader::getSize(); //.TODO: this suckz.... remove size from header
     
    153167      }
    154168      else
    155         creator = orxonox_cast<BaseObject*>(synchronisable_creator);
    156     }
     169        context = orxonox_cast<Context*>(synchronisable_context);
     170    }
     171    else
     172      context = Context::getRootContext();
     173
    157174    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));
    159176    assert(bo);
    160177    Synchronisable *no = orxonox_cast<Synchronisable*>(bo);
     
    162179    assert( Synchronisable::objectMap_.find(header.getObjectID()) == Synchronisable::objectMap_.end() );
    163180    no->setObjectID(header.getObjectID());
    164     //no->creatorID=header.getCreatorID(); //TODO: remove this
     181    //no->contextID=header.getContextID(); //TODO: remove this
    165182    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    }
    169190    //assert(no->classID_ == header.getClassID());
    170191    orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl;
     
    274295
    275296    header.setObjectID( this->objectID_ );
    276     header.setCreatorID( this->creatorID_ );
     297    header.setContextID( this->contextID_ );
    277298    header.setClassID( this->classID_ );
    278299    header.setDataSize( tempsize );
     
    331352      SynchronisableHeader syncHeader2(mem);
    332353      assert( this->getClassID() == syncHeader2.getClassID() );
    333       assert( this->getCreatorID() == syncHeader2.getCreatorID() );
     354      assert( this->getContextID() == syncHeader2.getContextID() );
    334355      mem += SynchronisableHeader::getSize();
    335356      std::vector<SynchronisableVariableBase *>::iterator i;
  • code/trunk/src/libraries/network/synchronisable/Synchronisable.h

    r8858 r9667  
    4040
    4141#include "util/mbool.h"
    42 #include "core/OrxonoxClass.h"
     42#include "util/Output.h"
     43#include "core/class/OrxonoxInterface.h"
    4344#include "SynchronisableVariable.h"
    4445#include "NetworkCallback.h"
     
    106107   * @brief: stores information about a Synchronisable
    107108   *
    108    * This class stores the information about a Synchronisable (objectID_, classID_, creatorID_, dataSize)
     109   * This class stores the information about a Synchronisable (objectID_, classID_, contextID_, dataSize)
    109110   * in an emulated bitset.
    110111   * Bit 1 to 31 store the size of the Data the synchronisable consumes in the stream
     
    112113   * Byte 5 to 8: objectID_
    113114   * Byte 9 to 12: classID_
    114    * Byte 13 to 16: creatorID_
     115   * Byte 13 to 16: contextID_
    115116   */
    116117  class _NetworkExport SynchronisableHeader: public SynchronisableHeaderLight
     
    125126      inline void setClassID(uint32_t classID_)
    126127        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()) = classID_; }
    127       inline uint32_t getCreatorID() const
     128      inline uint32_t getContextID() const
    128129        { return *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4); }
    129       inline void setCreatorID(uint32_t creatorID_)
    130         { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = creatorID_; }
     130      inline void setContextID(uint32_t contextID_)
     131        { *(uint32_t*)(data_+SynchronisableHeaderLight::getSize()+4) = contextID_; }
    131132      inline void operator=(SynchronisableHeader& h)
    132133        { memcpy(data_, h.data_, getSize()); }
     
    143144  * @author Oliver Scheuss
    144145  */
    145   class _NetworkExport Synchronisable : virtual public OrxonoxClass{
     146  class _NetworkExport Synchronisable : virtual public OrxonoxInterface {
    146147  public:
    147148    friend class packet::Gamestate;
     
    157158
    158159    inline uint32_t getObjectID() const {return this->objectID_;}
    159     inline unsigned int getCreatorID() const {return this->creatorID_;}
     160    inline unsigned int getContextID() const {return this->contextID_;}
    160161    inline uint32_t getClassID() const {return this->classID_;}
    161162    inline unsigned int getPriority() const { return this->objectFrequency_;}
     
    169170
    170171  protected:
    171     Synchronisable(BaseObject* creator);
     172    Synchronisable(Context* context);
    172173    template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
    173174    template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=0, bool bidirectional=false);
     
    175176
    176177    void setPriority(unsigned int freq){ objectFrequency_ = freq; }
    177 
     178    uint32_t findContextID(Context* context);
    178179
    179180  private:
     
    188189
    189190    uint32_t objectID_;
    190     uint32_t creatorID_;
     191    uint32_t contextID_;
    191192    uint32_t classID_;
    192193
  • code/trunk/src/libraries/tools/ParticleInterface.cc

    r8858 r9667  
    4343#include "util/Math.h"
    4444#include "core/CoreIncludes.h"
    45 #include "core/ConfigValueIncludes.h"
     45#include "core/config/ConfigValueIncludes.h"
    4646#include "core/GameMode.h"
    4747
  • code/trunk/src/libraries/tools/ResourceCollection.cc

    r8858 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(ResourceCollection);
     39    RegisterClass(ResourceCollection);
    4040
    41     ResourceCollection::ResourceCollection(BaseObject* creator)
    42         : BaseObject(creator)
     41    ResourceCollection::ResourceCollection(Context* context)
     42        : BaseObject(context)
    4343    {
    4444        RegisterObject(ResourceCollection);
  • code/trunk/src/libraries/tools/ResourceCollection.h

    r7401 r9667  
    4141    {
    4242    public:
    43         ResourceCollection(BaseObject* creator);
     43        ResourceCollection(Context* context);
    4444        virtual ~ResourceCollection();
    4545
  • code/trunk/src/libraries/tools/ResourceLocation.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(ResourceLocation);
     43    RegisterClass(ResourceLocation);
    4444
    45     ResourceLocation::ResourceLocation(BaseObject* creator)
    46         : BaseObject(creator)
     45    ResourceLocation::ResourceLocation(Context* context)
     46        : BaseObject(context)
    4747    {
    4848        RegisterObject(ResourceLocation);
  • code/trunk/src/libraries/tools/ResourceLocation.h

    r7401 r9667  
    4343
    4444    public:
    45         ResourceLocation(BaseObject* creator);
     45        ResourceLocation(Context* context);
    4646        virtual ~ResourceLocation();
    4747
  • code/trunk/src/libraries/tools/Shader.cc

    r9550 r9667  
    3939namespace orxonox
    4040{
     41    RegisterClassNoArgs(Shader);
     42
    4143    /**
    4244        @brief Initializes the values and sets the scene manager.
  • code/trunk/src/libraries/tools/Timer.cc

    r8729 r9667  
    132132    }
    133133
     134    RegisterClassNoArgs(Timer);
     135
    134136    /**
    135137        @brief Constructor: Sets the default-values.
     
    138140    {
    139141        this->init();
    140         RegisterRootObject(Timer);
     142        RegisterObject(Timer);
    141143    }
    142144
     
    151153    {
    152154        this->init();
    153         RegisterRootObject(Timer);
     155        RegisterObject(Timer);
    154156
    155157        this->setTimer(interval, bLoop, executor, bKillAfterCall);
  • code/trunk/src/libraries/tools/Timer.h

    r8858 r9667  
    7979#include "tools/ToolsPrereqs.h"
    8080
    81 #include "core/OrxonoxClass.h"
     81#include "core/class/OrxonoxClass.h"
    8282#include "core/command/ExecutorPtr.h"
    8383
     
    102102        on the game time.
    103103    */
    104     class _ToolsExport Timer : virtual public OrxonoxClass
     104    class _ToolsExport Timer : public OrxonoxClass
    105105    {
    106106        public:
  • code/trunk/src/libraries/tools/interfaces/Tickable.h

    r5781 r9667  
    4444#include "tools/ToolsPrereqs.h"
    4545
    46 #include "core/OrxonoxClass.h"
    47 #include "core/Super.h"
     46#include "core/class/OrxonoxInterface.h"
     47#include "core/class/Super.h"
    4848
    4949namespace orxonox
    5050{
    5151    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
    52     class _ToolsExport Tickable : virtual public OrxonoxClass
     52    class _ToolsExport Tickable : virtual public OrxonoxInterface
    5353    {
    5454        public:
  • code/trunk/src/libraries/tools/interfaces/TimeFactorListener.h

    r7172 r9667  
    3131
    3232#include "tools/ToolsPrereqs.h"
    33 #include "core/OrxonoxClass.h"
     33#include "core/object/Listable.h"
    3434
    3535namespace orxonox
    3636{
    37     class _ToolsExport TimeFactorListener : virtual public OrxonoxClass
     37    class _ToolsExport TimeFactorListener : virtual public Listable
    3838    {
    3939        public:
  • code/trunk/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc

    r7172 r9667  
    4646    float TimeFactorListener::timefactor_s = 1.0f;
    4747
     48    RegisterAbstractClass(TimeFactorListener).inheritsFrom(Class(Listable));
     49
    4850    TimeFactorListener::TimeFactorListener()
    4951    {
    50         RegisterRootObject(TimeFactorListener);
     52        RegisterObject(TimeFactorListener);
    5153    }
    5254
     
    6567    // Tickable
    6668    //----------------------------
     69    RegisterAbstractClass(Tickable).inheritsFrom(Class(OrxonoxInterface));
     70
    6771    /**
    6872        @brief Constructor: Registers the object in the Tickable-list
     
    7074    Tickable::Tickable()
    7175    {
    72         RegisterRootObject(Tickable);
     76        RegisterObject(Tickable);
    7377    }
    7478}
  • code/trunk/src/libraries/util/ScopedSingletonManager.h

    r8858 r9667  
    6868namespace orxonox
    6969{
    70     class OrxonoxClass;
     70    class Destroyable;
    7171
    7272    /**
     
    166166        }
    167167
    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*)
    170170        {
    171171            singletonPtr_->destroy();
     
    246246        }
    247247
    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*)
    250250        {
    251251            singletonPtr_->destroy();
  • code/trunk/src/modules/designtools/CreateStars.cc

    r8351 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(CreateStars);
     39    RegisterClass(CreateStars);
    4040
    41     CreateStars::CreateStars(BaseObject* creator) : BaseObject(creator)
     41    CreateStars::CreateStars(Context* context) : BaseObject(context)
    4242    {
    4343        RegisterObject(CreateStars);
     
    6969        for(int i=0; i < numStars_; i++)
    7070        {
    71             Billboard* bb = new Billboard(this);
     71            Billboard* bb = new Billboard(this->getContext());
    7272
    7373            float r = rnd(-colourDiff_,colourDiff_);
  • code/trunk/src/modules/designtools/CreateStars.h

    r7163 r9667  
    3838    {
    3939        public:
    40             CreateStars(orxonox::BaseObject* creator);
     40            CreateStars(Context* context);
    4141            virtual ~CreateStars();
    4242
  • code/trunk/src/modules/designtools/ScreenshotManager.cc

    r8858 r9667  
    4242#include <OgreViewport.h>
    4343
    44 #include "core/ConfigValueIncludes.h"
     44#include "core/CoreIncludes.h"
     45#include "core/config/ConfigValueIncludes.h"
    4546#include "core/GraphicsManager.h"
    4647#include "core/PathConfig.h"
     
    6869    ScreenshotManager::ScreenshotManager() : finalPicturePB_(NULL), data_(NULL)
    6970    {
    70         RegisterRootObject(ScreenshotManager);
     71        RegisterObject(ScreenshotManager);
    7172       
    7273        this->setConfigValues();
  • code/trunk/src/modules/designtools/ScreenshotManager.h

    r8413 r9667  
    4444
    4545#include "util/Singleton.h"
    46 #include "core/OrxonoxClass.h"
     46#include "core/config/Configurable.h"
    4747
    4848namespace orxonox
     
    6161    @ingroup Designtools
    6262    */
    63     class ScreenshotManager : public OrxonoxClass, public Singleton<ScreenshotManager>
     63    class ScreenshotManager : public Configurable, public Singleton<ScreenshotManager>
    6464    {
    6565        friend class Singleton<ScreenshotManager>;
  • code/trunk/src/modules/designtools/SkyboxGenerator.cc

    r8858 r9667  
    4040#include "util/ScopedSingletonManager.h"
    4141#include "core/CoreIncludes.h"
    42 #include "core/ConfigValueIncludes.h"
     42#include "core/config/ConfigValueIncludes.h"
    4343#include "core/GraphicsManager.h"
    4444#include "core/PathConfig.h"
     
    6868    SkyboxGenerator::SkyboxGenerator()
    6969    {
    70         RegisterRootObject(SkyboxGenerator);
     70        RegisterObject(SkyboxGenerator);
    7171
    7272        this->setConfigValues();
  • code/trunk/src/modules/designtools/SkyboxGenerator.h

    r8232 r9667  
    3636#define __SkyboxGenerator_h__
    3737
    38 #include "core/OrxonoxClass.h"
     38#include "core/config/Configurable.h"
    3939#include "util/Singleton.h"
    4040#include "tools/interfaces/Tickable.h"
     
    5858    @ingroup Designtools
    5959    */
    60     class SkyboxGenerator : public virtual OrxonoxClass, public Singleton<SkyboxGenerator>, public Tickable
     60    class SkyboxGenerator : public virtual Configurable, public Singleton<SkyboxGenerator>, public Tickable
    6161    {
    6262        friend class Singleton<SkyboxGenerator>;
  • code/trunk/src/modules/docking/Dock.cc

    r8858 r9667  
    4646namespace orxonox
    4747{
    48     CreateFactory(Dock);
     48    RegisterClass(Dock);
    4949
    5050    SetConsoleCommand("Dock", "dock",    &Dock::cmdDock).addShortcut().setAsInputCommand();
     
    5353    registerStaticNetworkFunction(Dock::showDockingDialog);
    5454
    55     Dock::Dock(BaseObject* creator) : StaticEntity(creator)
     55    Dock::Dock(Context* context) : StaticEntity(context)
    5656    {
    5757        RegisterObject(Dock);
  • code/trunk/src/modules/docking/Dock.h

    r8706 r9667  
    4040#include <set>
    4141
    42 #include "core/CoreIncludes.h"
    4342#include "core/EventIncludes.h"
    4443#include "core/XMLPort.h"
     
    5857    { // tolua_export
    5958        public:
    60             Dock(BaseObject* creator);
     59            Dock(Context* context);
    6160            virtual ~Dock();
    6261
  • code/trunk/src/modules/docking/DockToShip.cc

    r8858 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(DockToShip);
     40    RegisterClass(DockToShip);
    4141
    42     DockToShip::DockToShip(BaseObject* creator) : DockingEffect(creator)
     42    DockToShip::DockToShip(Context* context) : DockingEffect(context)
    4343    {
    4444        RegisterObject(DockToShip);
  • code/trunk/src/modules/docking/DockToShip.h

    r8706 r9667  
    5757    {
    5858        public:
    59             DockToShip(BaseObject* creator);
     59            DockToShip(Context* context);
    6060            virtual ~DockToShip();
    6161
  • code/trunk/src/modules/docking/DockingAnimation.cc

    r8706 r9667  
    3535
    3636#include "DockingEffect.h"  // For DockingEffect::findTarget
     37#include "core/CoreIncludes.h"
    3738
    3839namespace orxonox
    3940{
    40     DockingAnimation::DockingAnimation(BaseObject* creator) : BaseObject(creator)
     41    RegisterAbstractClass(DockingAnimation).inheritsFrom(Class(BaseObject));
     42
     43    DockingAnimation::DockingAnimation(Context* context) : BaseObject(context)
    4144    {
    4245        RegisterObject(DockingAnimation);
  • code/trunk/src/modules/docking/DockingAnimation.h

    r8706 r9667  
    3636#define _DockingAnimation_H__
    3737
    38 #include "core/CoreIncludes.h"
    3938#include "core/XMLPort.h"
    4039
     
    6463    {
    6564        public:
    66             DockingAnimation(BaseObject* creator);
     65            DockingAnimation(Context* context);
    6766            virtual ~DockingAnimation();
    6867
  • code/trunk/src/modules/docking/DockingController.cc

    r9348 r9667  
    3434#include "worldentities/ControllableEntity.h"
    3535#include "Dock.h"
     36#include "core/CoreIncludes.h"
    3637
    3738namespace orxonox
    3839{
    39     CreateFactory(DockingController);
     40    RegisterClass(DockingController);
    4041
    41     DockingController::DockingController(BaseObject* creator) : ArtificialController(creator)
     42    DockingController::DockingController(Context* context) : ArtificialController(context)
    4243    {
    4344        RegisterObject(DockingController);
  • code/trunk/src/modules/docking/DockingController.h

    r8706 r9667  
    4242    {
    4343        public:
    44             DockingController(BaseObject* creator);
     44            DockingController(Context* context);
    4545            virtual ~DockingController();
    4646
  • code/trunk/src/modules/docking/DockingEffect.cc

    r8706 r9667  
    3333
    3434#include "DockingEffect.h"
     35#include "core/CoreIncludes.h"
    3536
    3637namespace orxonox
    3738{
    38     DockingEffect::DockingEffect(BaseObject* creator) : BaseObject(creator)
     39    RegisterAbstractClass(DockingEffect).inheritsFrom(Class(BaseObject));
     40
     41    DockingEffect::DockingEffect(Context* context) : BaseObject(context)
    3942    {
    4043        RegisterObject(DockingEffect);
  • code/trunk/src/modules/docking/DockingEffect.h

    r8706 r9667  
    3636#define _DockingEffect_H__
    3737
    38 #include "core/CoreIncludes.h"
    3938#include "core/XMLPort.h"
    4039
     
    6261    {
    6362        public:
    64             DockingEffect(BaseObject* creator);
     63            DockingEffect(Context* context);
    6564            virtual ~DockingEffect();
    6665
  • code/trunk/src/modules/docking/DockingPrecompiledHeaders.h

    r8706 r9667  
    4545
    4646#include "core/BaseObject.h"
    47 #include "core/CoreIncludes.h"
    4847#include "core/XMLPort.h"
    4948
  • code/trunk/src/modules/docking/DockingTarget.cc

    r8858 r9667  
    3333
    3434#include "DockingTarget.h"
     35#include "core/CoreIncludes.h"
    3536#include "core/XMLPort.h"
    3637
     
    3839namespace orxonox
    3940{
    40     CreateFactory(DockingTarget);
     41    RegisterClass(DockingTarget);
    4142
    42     DockingTarget::DockingTarget(BaseObject* creator) : StaticEntity(creator)
     43    DockingTarget::DockingTarget(Context* context) : StaticEntity(context)
    4344    {
    4445        RegisterObject(DockingTarget);
  • code/trunk/src/modules/docking/DockingTarget.h

    r8706 r9667  
    5555    {
    5656        public:
    57             DockingTarget(BaseObject* creator);
     57            DockingTarget(Context* context);
    5858            virtual ~DockingTarget();
    5959
  • code/trunk/src/modules/docking/MoveToDockingTarget.cc

    r8706 r9667  
    3636
    3737#include "core/XMLPort.h"
     38#include "core/CoreIncludes.h"
    3839
    3940namespace orxonox
    4041{
    41     CreateFactory(MoveToDockingTarget);
     42    RegisterClass(MoveToDockingTarget);
    4243
    43     MoveToDockingTarget::MoveToDockingTarget(BaseObject *creator) : DockingAnimation(creator)
     44    MoveToDockingTarget::MoveToDockingTarget(Context* context) : DockingAnimation(context)
    4445    {
    4546        RegisterObject(MoveToDockingTarget);
     
    5455        assert(this->parent_);
    5556
    56         DockingController *dockingController = new DockingController(this);
     57        DockingController *dockingController = new DockingController(this->getContext());
    5758        dockingController->setDock(this->parent_);
    5859        dockingController->setPlayer(player);
  • code/trunk/src/modules/docking/MoveToDockingTarget.h

    r8706 r9667  
    5656    {
    5757        public:
    58             MoveToDockingTarget(BaseObject* creator);
     58            MoveToDockingTarget(Context* context);
    5959            virtual ~MoveToDockingTarget();
    6060
  • code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc

    r9348 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(OldRaceCheckPoint);
     40    RegisterClass(OldRaceCheckPoint);
    4141
    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))
    4343    {
    4444        RegisterObject(OldRaceCheckPoint);
  • code/trunk/src/modules/gametypes/OldRaceCheckPoint.h

    r9348 r9667  
    4545    {
    4646        public:
    47             OldRaceCheckPoint(BaseObject* creator);
     47            OldRaceCheckPoint(Context* context);
    4848            virtual ~OldRaceCheckPoint();
    4949
  • code/trunk/src/modules/gametypes/OldSpaceRace.cc

    r9348 r9667  
    3636namespace orxonox
    3737{
    38     CreateUnloadableFactory(OldSpaceRace);
     38    RegisterUnloadableClass(OldSpaceRace);
    3939
    40     OldSpaceRace::OldSpaceRace(BaseObject* creator) : Gametype(creator)
     40    OldSpaceRace::OldSpaceRace(Context* context) : Gametype(context)
    4141    {
    4242        RegisterObject(OldSpaceRace);
  • code/trunk/src/modules/gametypes/OldSpaceRace.h

    r9348 r9667  
    5252
    5353        public:
    54             OldSpaceRace(BaseObject* creator);
     54            OldSpaceRace(Context* context);
    5555            virtual ~OldSpaceRace() {}
    5656
  • code/trunk/src/modules/gametypes/RaceCheckPoint.cc

    r9526 r9667  
    4141namespace orxonox
    4242{
    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))
    4747    {
    4848        RegisterObject(RaceCheckPoint);
     
    157157        if (players_.size() > 0)
    158158        {
    159             for (int i = 0; i < players_.size(); i++)
     159            for (size_t i = 0; i < players_.size(); i++)
    160160            {
    161161                if (this->players_[i]->getClientID() == clientID)
     
    172172        if (players_.size() > 0)
    173173        {
    174             for (int i = 0; i < players_.size(); i++)
     174            for (size_t i = 0; i < players_.size(); i++)
    175175            {
    176176                if (this->players_[i] == player)
  • code/trunk/src/modules/gametypes/RaceCheckPoint.h

    r9526 r9667  
    4545    {
    4646        public:
    47             RaceCheckPoint(BaseObject* creator);
     47            RaceCheckPoint(Context* context);
    4848            virtual ~RaceCheckPoint();
    4949
     
    7070            }
    7171
    72             const std::set<int>& getNextCheckpoints()
     72            std::set<int> getNextCheckpoints()
    7373            {
    7474                return nextCheckpoints_;
  • code/trunk/src/modules/gametypes/SpaceRace.cc

    r9526 r9667  
    4040namespace orxonox
    4141{
    42     CreateUnloadableFactory(SpaceRace);
     42    RegisterUnloadableClass(SpaceRace);
    4343
    44     SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator)
     44    SpaceRace::SpaceRace(Context* context) : Gametype(context)
    4545    {
    4646        RegisterObject(SpaceRace);
  • code/trunk/src/modules/gametypes/SpaceRace.h

    r9263 r9667  
    5454
    5555        public:
    56             SpaceRace(BaseObject* creator);
     56            SpaceRace(Context* context);
    5757            virtual ~SpaceRace() {}
    5858
  • code/trunk/src/modules/gametypes/SpaceRaceBot.cc

    r9526 r9667  
    2929namespace orxonox
    3030{
    31     CreateFactory(SpaceRaceBot);
     31    RegisterClass(SpaceRaceBot);
    3232
    33     SpaceRaceBot::SpaceRaceBot(BaseObject* creator) : Bot(creator){
     33    SpaceRaceBot::SpaceRaceBot(Context* context) : Bot(context){
    3434        RegisterObject(SpaceRaceBot);
    3535        this->defaultController_ = Class(SpaceRaceController);// ClassByString("")
  • code/trunk/src/modules/gametypes/SpaceRaceBot.h

    r9526 r9667  
    4141    {
    4242        public:
    43         SpaceRaceBot(BaseObject* creator);
     43        SpaceRaceBot(Context* context);
    4444            virtual ~SpaceRaceBot() {}
    4545    };
  • code/trunk/src/modules/gametypes/SpaceRaceController.cc

    r9526 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(SpaceRaceController);
     47    RegisterClass(SpaceRaceController);
    4848
    4949    const int ADJUSTDISTANCE = 500;
     
    5252     * Idea: Find static Point (checkpoints the spaceship has to reach)
    5353     */
    54     SpaceRaceController::SpaceRaceController(BaseObject* creator) :
    55         ArtificialController(creator)
     54    SpaceRaceController::SpaceRaceController(Context* context) :
     55        ArtificialController(context)
    5656    {
    5757        RegisterObject(SpaceRaceController)
     
    8686
    8787        }//ausgabe*/
    88 
     88        /*
    8989        for (std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it != checkpoints.end(); ++it)
    9090        {
     
    100100                }
    101101            }
    102         }/*
     102        }
     103        */
     104        /*
    103105        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
    104106        {
     
    301303    {
    302304        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];
    305307        return NULL;
    306308    }
     
    340342        //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;
    341343        //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<<";       ";
    343345         temp=previousCheckpoint->getNextCheckpointsAsVector3();
    344346         orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<":       "<<temp.x<<", "<<temp.y<<", "<<temp.z<<";       ";
    345          orxout()<<endl;*//*
     347         orxout()<<endl;
    346348        return newTempRaceCheckPoint;
    347349    }*/
  • code/trunk/src/modules/gametypes/SpaceRaceController.h

    r9526 r9667  
    6565
    6666        public:
    67             SpaceRaceController(BaseObject* creator);
     67            SpaceRaceController(Context* context);
    6868            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6969            virtual ~SpaceRaceController();
  • code/trunk/src/modules/gametypes/SpaceRaceManager.cc

    r9526 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(SpaceRaceManager);
     42    RegisterClass(SpaceRaceManager);
    4343
    44     SpaceRaceManager::SpaceRaceManager(BaseObject* creator) :
    45         BaseObject(creator)
     44    SpaceRaceManager::SpaceRaceManager(Context* context) :
     45        BaseObject(context)
    4646    {
    4747        RegisterObject(SpaceRaceManager);
  • code/trunk/src/modules/gametypes/SpaceRaceManager.h

    r9526 r9667  
    5555
    5656        public:
    57             SpaceRaceManager(BaseObject* creator);
     57            SpaceRaceManager(Context* context);
    5858            virtual ~SpaceRaceManager() ;
    5959
  • code/trunk/src/modules/notifications/NotificationDispatcher.cc

    r8891 r9667  
    4848{
    4949
    50     CreateUnloadableFactory(NotificationDispatcher);
     50    RegisterUnloadableClass(NotificationDispatcher);
    5151
    5252    registerMemberNetworkFunction(NotificationDispatcher, broadcastHelper);
     
    5757        Default constructor. Initializes the object.
    5858    */
    59     NotificationDispatcher::NotificationDispatcher(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     59    NotificationDispatcher::NotificationDispatcher(Context* context) : BaseObject(context), Synchronisable(context)
    6060    {
    6161        RegisterObject(NotificationDispatcher);
  • code/trunk/src/modules/notifications/NotificationDispatcher.h

    r8891 r9667  
    7676    {
    7777        public:
    78             NotificationDispatcher(BaseObject* creator); //!< Default constructor. Initializes the object.
     78            NotificationDispatcher(Context* context); //!< Default constructor. Initializes the object.
    7979            virtual ~NotificationDispatcher(); //!< Destructor.
    8080
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r8858 r9667  
    5555    NotificationManager::NotificationManager()
    5656    {
    57         RegisterRootObject(NotificationManager);
     57        RegisterObject(NotificationManager);
    5858
    5959        orxout(internal_info, context::notifications) << "NotificatioManager created." << endl;
  • code/trunk/src/modules/notifications/NotificationManager.h

    r8706 r9667  
    4242#include <string>
    4343
    44 #include "core/OrxonoxClass.h"
    4544#include "util/Singleton.h"
    4645#include "interfaces/NotificationListener.h"
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r9253 r9667  
    4444{
    4545
    46     CreateFactory(NotificationQueue);
     46    RegisterClass(NotificationQueue);
    4747
    4848    /**
     
    5252        The creator of the NotificationQueue.
    5353    */
    54     NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), registered_(false)
     54    NotificationQueue::NotificationQueue(Context* context) : BaseObject(context), Synchronisable(context), registered_(false)
    5555    {
    5656        RegisterObject(NotificationQueue);
  • code/trunk/src/modules/notifications/NotificationQueue.h

    r8706 r9667  
    9494
    9595        public:
    96             NotificationQueue(BaseObject* creator);
     96            NotificationQueue(Context* context);
    9797            virtual ~NotificationQueue();
    9898
  • code/trunk/src/modules/notifications/NotificationQueueCEGUI.cc

    r8858 r9667  
    4646{
    4747
    48     CreateFactory(NotificationQueueCEGUI);
     48    RegisterClass(NotificationQueueCEGUI);
    4949
    5050    /*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer");
    5151
    52     NotificationQueueCEGUI::NotificationQueueCEGUI(BaseObject* creator) : NotificationQueue(creator)
     52    NotificationQueueCEGUI::NotificationQueueCEGUI(Context* context) : NotificationQueue(context)
    5353    {
    5454        RegisterObject(NotificationQueueCEGUI);
  • code/trunk/src/modules/notifications/NotificationQueueCEGUI.h

    r8706 r9667  
    7070
    7171        public:
    72             NotificationQueueCEGUI(BaseObject* creator);
     72            NotificationQueueCEGUI(Context* context);
    7373            virtual ~NotificationQueueCEGUI();
    7474
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc

    r9550 r9667  
    4444namespace orxonox {
    4545
    46     CreateFactory(CommandNotification);
     46    RegisterClass(CommandNotification);
    4747
    4848    /**
     
    5050        Default Constructor. Registers the object and initializes variables.
    5151    */
    52     CommandNotification::CommandNotification(BaseObject* creator) : NotificationDispatcher(creator)
     52    CommandNotification::CommandNotification(Context* context) : NotificationDispatcher(context)
    5353    {
    5454        RegisterObject(CommandNotification);
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.h

    r7552 r9667  
    7070
    7171        public:
    72             CommandNotification(BaseObject* creator); //!< Default Constructor.
     72            CommandNotification(Context* context); //!< Default Constructor.
    7373            virtual ~CommandNotification(); //!< Destructor.
    7474
  • code/trunk/src/modules/notifications/dispatchers/SimpleNotification.cc

    r8706 r9667  
    3939namespace orxonox {
    4040
    41     CreateFactory(SimpleNotification);
     41    RegisterClass(SimpleNotification);
    4242
    4343    /**
     
    4545        Default Constructor. Registers the object and initializes variables.
    4646    */
    47     SimpleNotification::SimpleNotification(BaseObject* creator) : NotificationDispatcher(creator)
     47    SimpleNotification::SimpleNotification(Context* context) : NotificationDispatcher(context)
    4848    {
    4949        RegisterObject(SimpleNotification);
  • code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h

    r7552 r9667  
    6767    {
    6868        public:
    69             SimpleNotification(BaseObject* creator); //!< Default Constructor.
     69            SimpleNotification(Context* context); //!< Default Constructor.
    7070            virtual ~SimpleNotification(); //!< Destructor.
    7171
  • code/trunk/src/modules/objects/Attacher.cc

    r6417 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(Attacher);
     36    RegisterClass(Attacher);
    3737
    38     Attacher::Attacher(BaseObject* creator) : StaticEntity(creator)
     38    Attacher::Attacher(Context* context) : StaticEntity(context)
    3939    {
    4040        RegisterObject(Attacher);
  • code/trunk/src/modules/objects/Attacher.h

    r7601 r9667  
    4848    {
    4949        public:
    50             Attacher(BaseObject* creator);
     50            Attacher(Context* context);
    5151            virtual ~Attacher() {}
    5252
  • code/trunk/src/modules/objects/ForceField.cc

    r8858 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(ForceField);
     42    RegisterClass(ForceField);
    4343
    4444    /*static*/ const std::string ForceField::modeTube_s = "tube";
     
    5353        Constructor. Registers the object and initializes some values.
    5454    */
    55     ForceField::ForceField(BaseObject* creator) : StaticEntity(creator)
     55    ForceField::ForceField(Context* context) : StaticEntity(context)
    5656    {
    5757        RegisterObject(ForceField);
  • code/trunk/src/modules/objects/ForceField.h

    r8397 r9667  
    8686    {
    8787        public:
    88             ForceField(BaseObject* creator);
     88            ForceField(Context* context);
    8989            virtual ~ForceField();
    9090
  • code/trunk/src/modules/objects/Planet.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(Planet);
     44    RegisterClass(Planet);
    4545
    4646    /**
    4747     * @brief Constructor
    4848     */
    49     Planet::Planet(BaseObject* creator) : MovableEntity(creator)
     49    Planet::Planet(Context* context) : MovableEntity(context)
    5050    {
    5151        RegisterObject(Planet);
  • code/trunk/src/modules/objects/Planet.h

    r7601 r9667  
    4848    {
    4949        public:
    50             Planet(BaseObject* creator);
     50            Planet(Context* context);
    5151
    5252            virtual ~Planet();
  • code/trunk/src/modules/objects/Script.cc

    r8858 r9667  
    4646namespace orxonox
    4747{
    48     CreateFactory(Script);
     48    RegisterClass(Script);
    4949
    5050    registerStaticNetworkFunction(Script::executeHelper);
     
    6161        The creator of this object.
    6262    */
    63     Script::Script(BaseObject* creator) : BaseObject(creator)
     63    Script::Script(Context* context) : BaseObject(context)
    6464    {
    6565        RegisterObject(Script);
  • code/trunk/src/modules/objects/Script.h

    r7601 r9667  
    9595    {
    9696        public:
    97             Script(BaseObject* creator);
     97            Script(Context* context);
    9898            virtual ~Script();
    9999
  • code/trunk/src/modules/objects/SpaceBoundaries.cc

    r8858 r9667  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "core/ObjectListIterator.h"
     34#include "core/object/ObjectListIterator.h"
    3535#include "core/XMLPort.h"
    3636
     
    4242namespace orxonox
    4343{
    44     CreateFactory(SpaceBoundaries);
    45 
    46     SpaceBoundaries::SpaceBoundaries(BaseObject* creator) : StaticEntity(creator)
     44    RegisterClass(SpaceBoundaries);
     45
     46    SpaceBoundaries::SpaceBoundaries(Context* context) : StaticEntity(context)
    4747    {
    4848        RegisterObject(SpaceBoundaries);
     
    7373    {
    7474        pawnsIn_.clear();
    75         for(ObjectListIterator<Pawn> current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)
     75        for(ObjectList<Pawn>::iterator current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)
    7676        {
    7777            Pawn* currentPawn = *current;
     
    104104        if (current == this->billboards_.size())
    105105        {
    106             Billboard* billboard = new Billboard(this);
     106            Billboard* billboard = new Billboard(this->getContext());
    107107            billboard->setPosition(position);
    108108            billboard->setSyncMode(ObjectDirection::None);
  • code/trunk/src/modules/objects/SpaceBoundaries.h

    r8767 r9667  
    3636#include <vector>
    3737
    38 #include "core/CoreIncludes.h"
    39 #include "core/WeakPtr.h"
     38#include "core/object/WeakPtr.h"
    4039
    4140#include "tools/interfaces/Tickable.h"
     
    7675    {
    7776        public:
    78             SpaceBoundaries(BaseObject* creator);
     77            SpaceBoundaries(Context* context);
    7978            ~SpaceBoundaries();
    8079
  • code/trunk/src/modules/objects/Turret.cc

    r9526 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(Turret);
     37    RegisterClass(Turret);
    3838
    3939    /**
    4040     * @brief Constructor
    4141     */
    42     Turret::Turret(BaseObject* creator) : SpaceShip(creator)
     42    Turret::Turret(Context* context) : SpaceShip(context)
    4343    {
    4444        RegisterObject(Turret);
    45         this->controller_ = new WaypointPatrolController(this);
     45        this->controller_ = new WaypointPatrolController(this->getContext());
    4646    }
    4747
  • code/trunk/src/modules/objects/Turret.h

    r9526 r9667  
    4545    {
    4646        public:
    47             Turret(BaseObject* creator);
     47            Turret(Context* context);
    4848            virtual ~Turret();
    4949
  • code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(BoxCollisionShape);
     44    RegisterClass(BoxCollisionShape);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     BoxCollisionShape::BoxCollisionShape(BaseObject* creator) : CollisionShape(creator)
     50    BoxCollisionShape::BoxCollisionShape(Context* context) : CollisionShape(context)
    5151    {
    5252        RegisterObject(BoxCollisionShape);
  • code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h

    r8706 r9667  
    5757    {
    5858        public:
    59             BoxCollisionShape(BaseObject* creator);
     59            BoxCollisionShape(Context* context);
    6060            virtual ~BoxCollisionShape();
    6161
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(ConeCollisionShape);
     44    RegisterClass(ConeCollisionShape);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     ConeCollisionShape::ConeCollisionShape(BaseObject* creator) : CollisionShape(creator)
     50    ConeCollisionShape::ConeCollisionShape(Context* context) : CollisionShape(context)
    5151    {
    5252        RegisterObject(ConeCollisionShape);
  • code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h

    r8706 r9667  
    5555    {
    5656        public:
    57             ConeCollisionShape(BaseObject* creator);
     57            ConeCollisionShape(Context* context);
    5858            virtual ~ConeCollisionShape();
    5959
  • code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(PlaneCollisionShape);
     44    RegisterClass(PlaneCollisionShape);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     PlaneCollisionShape::PlaneCollisionShape(BaseObject* creator) : CollisionShape(creator)
     50    PlaneCollisionShape::PlaneCollisionShape(Context* context) : CollisionShape(context)
    5151    {
    5252        RegisterObject(PlaneCollisionShape);
  • code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h

    r8706 r9667  
    5757    {
    5858        public:
    59             PlaneCollisionShape(BaseObject* creator);
     59            PlaneCollisionShape(Context* context);
    6060            virtual ~PlaneCollisionShape();
    6161
  • code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(SphereCollisionShape);
     44    RegisterClass(SphereCollisionShape);
    4545
    4646    /**
     
    4848        Constructor. registers and initializes the object.
    4949    */
    50     SphereCollisionShape::SphereCollisionShape(BaseObject* creator) : CollisionShape(creator)
     50    SphereCollisionShape::SphereCollisionShape(Context* context) : CollisionShape(context)
    5151    {
    5252        RegisterObject(SphereCollisionShape);
  • code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h

    r8706 r9667  
    5555    {
    5656        public:
    57             SphereCollisionShape(BaseObject* creator);
     57            SphereCollisionShape(Context* context);
    5858            virtual ~SphereCollisionShape();
    5959
  • code/trunk/src/modules/objects/eventsystem/EventDispatcher.cc

    r5929 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(EventDispatcher);
     37    RegisterClass(EventDispatcher);
    3838
    39     EventDispatcher::EventDispatcher(BaseObject* creator) : BaseObject(creator)
     39    EventDispatcher::EventDispatcher(Context* context) : BaseObject(context)
    4040    {
    4141        RegisterObject(EventDispatcher);
  • code/trunk/src/modules/objects/eventsystem/EventDispatcher.h

    r7601 r9667  
    4646    {
    4747        public:
    48             EventDispatcher(BaseObject* creator);
     48            EventDispatcher(Context* context);
    4949            virtual ~EventDispatcher();
    5050
  • code/trunk/src/modules/objects/eventsystem/EventFilter.cc

    r8858 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(EventFilter);
     38    RegisterClass(EventFilter);
    3939
    40     EventFilter::EventFilter(BaseObject* creator) : BaseObject(creator)
     40    EventFilter::EventFilter(Context* context) : BaseObject(context)
    4141    {
    4242        RegisterObject(EventFilter);
  • code/trunk/src/modules/objects/eventsystem/EventFilter.h

    r7601 r9667  
    4646    {
    4747        public:
    48             EventFilter(BaseObject* creator);
     48            EventFilter(Context* context);
    4949            virtual ~EventFilter();
    5050
  • code/trunk/src/modules/objects/eventsystem/EventListener.cc

    r8858 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(EventListener);
     37    RegisterClass(EventListener);
    3838
    39     EventListener::EventListener(BaseObject* creator) : BaseObject(creator)
     39    EventListener::EventListener(Context* context) : BaseObject(context)
    4040    {
    4141        RegisterObject(EventListener);
  • code/trunk/src/modules/objects/eventsystem/EventListener.h

    r7601 r9667  
    4747    {
    4848        public:
    49             EventListener(BaseObject* creator);
     49            EventListener(Context* context);
    5050            virtual ~EventListener();
    5151
  • code/trunk/src/modules/objects/eventsystem/EventName.cc

    r5929 r9667  
    3232namespace orxonox
    3333{
    34     CreateFactory(EventName);
     34    RegisterClass(EventName);
    3535
    36     EventName::EventName(BaseObject* creator) : BaseObject(creator)
     36    EventName::EventName(Context* context) : BaseObject(context)
    3737    {
    3838        RegisterObject(EventName);
  • code/trunk/src/modules/objects/eventsystem/EventName.h

    r7601 r9667  
    4545    {
    4646        public:
    47             EventName(BaseObject* creator);
     47            EventName(Context* context);
    4848            virtual ~EventName() {}
    4949    };
  • code/trunk/src/modules/objects/eventsystem/EventTarget.cc

    r8858 r9667  
    3333namespace orxonox
    3434{
    35     CreateFactory(EventTarget);
     35    RegisterClass(EventTarget);
    3636
    37     EventTarget::EventTarget(BaseObject* creator) : BaseObject(creator)
     37    EventTarget::EventTarget(Context* context) : BaseObject(context)
    3838    {
    3939        RegisterObject(EventTarget);
  • code/trunk/src/modules/objects/eventsystem/EventTarget.h

    r7601 r9667  
    4646    {
    4747        public:
    48             EventTarget(BaseObject* creator);
     48            EventTarget(Context* context);
    4949            virtual ~EventTarget();
    5050
  • code/trunk/src/modules/objects/triggers/CheckPoint.cc

    r9348 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(CheckPoint);
     44    RegisterClass(CheckPoint);
    4545
    46     CheckPoint::CheckPoint(BaseObject* creator)
    47         : DistanceTrigger(creator)
    48         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     46    CheckPoint::CheckPoint(Context* context)
     47        : DistanceTrigger(context)
     48        , RadarViewable(this, static_cast<WorldEntity*>(this))
    4949    {
    5050        RegisterObject(CheckPoint);
  • code/trunk/src/modules/objects/triggers/CheckPoint.h

    r7601 r9667  
    5555    {
    5656    public:
    57         CheckPoint(BaseObject* creator);
     57        CheckPoint(Context* context);
    5858        virtual ~CheckPoint();
    5959
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r8858 r9667  
    4747    /*static*/ const std::string DistanceMultiTrigger::beaconModeExlcude_s = "exclude";
    4848   
    49     CreateFactory(DistanceMultiTrigger);
     49    RegisterClass(DistanceMultiTrigger);
    5050
    5151    /**
     
    5353        Default Constructor. Registers the object and initializes default values.
    5454    */
    55     DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator)
     55    DistanceMultiTrigger::DistanceMultiTrigger(Context* context) : MultiTrigger(context)
    5656    {
    5757        RegisterObject(DistanceMultiTrigger);
  • code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h

    r9016 r9667  
    4040#include <map>
    4141
    42 #include "core/WeakPtr.h"
     42#include "core/object/WeakPtr.h"
    4343
    4444#include "worldentities/WorldEntity.h"
     
    9595
    9696        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.
    9898            virtual ~DistanceMultiTrigger(); // Destructor.
    9999
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.cc

    r8858 r9667  
    4949    /*static*/ const std::string DistanceTrigger::beaconModeExlcude_s = "exclude";
    5050
    51     CreateFactory(DistanceTrigger);
     51    RegisterClass(DistanceTrigger);
    5252
    5353    /**
     
    5757        The creator of this trigger.
    5858    */
    59     DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)
     59    DistanceTrigger::DistanceTrigger(Context* context) : Trigger(context)
    6060    {
    6161        RegisterObject(DistanceTrigger);
  • code/trunk/src/modules/objects/triggers/DistanceTrigger.h

    r8706 r9667  
    9797    {
    9898        public:
    99             DistanceTrigger(BaseObject* creator); // Constructor. Registers and initializes the object.
     99            DistanceTrigger(Context* context); // Constructor. Registers and initializes the object.
    100100            virtual ~DistanceTrigger();
    101101
  • code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.cc

    r7601 r9667  
    4040{
    4141
    42     CreateFactory(DistanceTriggerBeacon);
     42    RegisterClass(DistanceTriggerBeacon);
    4343
    4444    /**
     
    4848        The creator of this object.
    4949    */
    50     DistanceTriggerBeacon::DistanceTriggerBeacon(BaseObject* creator) : StaticEntity(creator)
     50    DistanceTriggerBeacon::DistanceTriggerBeacon(Context* context) : StaticEntity(context)
    5151    {
    5252        RegisterObject(DistanceTriggerBeacon);
  • code/trunk/src/modules/objects/triggers/DistanceTriggerBeacon.h

    r7601 r9667  
    5757
    5858        public:
    59             DistanceTriggerBeacon(BaseObject* creator); //!< Constructor.
     59            DistanceTriggerBeacon(Context* context); //!< Constructor.
    6060            virtual ~DistanceTriggerBeacon() {} //!< Destructor.
    6161
  • code/trunk/src/modules/objects/triggers/EventMultiTrigger.cc

    r7601 r9667  
    4343{
    4444
    45     CreateFactory(EventMultiTrigger);
     45    RegisterClass(EventMultiTrigger);
    4646
    4747    /**
     
    4949        Constructor. Registers the object.
    5050    */
    51     EventMultiTrigger::EventMultiTrigger(BaseObject* creator) : MultiTrigger(creator)
     51    EventMultiTrigger::EventMultiTrigger(Context* context) : MultiTrigger(context)
    5252    {
    5353        RegisterObject(EventMultiTrigger);
  • code/trunk/src/modules/objects/triggers/EventMultiTrigger.h

    r8213 r9667  
    7373
    7474        public:
    75             EventMultiTrigger(BaseObject* creator); //!< Constructor. Registers the object.
     75            EventMultiTrigger(Context* context); //!< Constructor. Registers the object.
    7676            virtual ~EventMultiTrigger(); //!< Destructor.
    7777
  • code/trunk/src/modules/objects/triggers/EventTrigger.cc

    r8213 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(EventTrigger);
     42    RegisterClass(EventTrigger);
    4343
    4444    /**
     
    4848        The creator of the EventTrigger.
    4949    */
    50     EventTrigger::EventTrigger(BaseObject* creator) : Trigger(creator)
     50    EventTrigger::EventTrigger(Context* context) : Trigger(context)
    5151    {
    5252        RegisterObject(EventTrigger);
  • code/trunk/src/modules/objects/triggers/EventTrigger.h

    r8706 r9667  
    7070    {
    7171        public:
    72             EventTrigger(BaseObject* creator); // Constructor. Registers and initializes the object.
     72            EventTrigger(Context* context); // Constructor. Registers and initializes the object.
    7373            virtual ~EventTrigger();
    7474
  • code/trunk/src/modules/objects/triggers/MultiTrigger.cc

    r8858 r9667  
    4343{
    4444
    45     CreateFactory(MultiTrigger);
     45    RegisterClass(MultiTrigger);
    4646
    4747    /**
     
    5151        The creator.
    5252    */
    53     MultiTrigger::MultiTrigger(BaseObject* creator) : TriggerBase(creator)
     53    MultiTrigger::MultiTrigger(Context* context) : TriggerBase(context)
    5454    {
    5555        RegisterObject(MultiTrigger);
     
    451451        }
    452452
    453         MultiTriggerContainer* container = new MultiTriggerContainer(this, this, originator);
     453        MultiTriggerContainer* container = new MultiTriggerContainer(this->getContext(), this, originator);
    454454        this->fireEvent(status, container);
    455455        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  
    9999    {
    100100        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.
    102102            virtual ~MultiTrigger(); //!< Destructor.
    103103
  • code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc

    r8706 r9667  
    4242{
    4343
    44     CreateUnloadableFactory(MultiTriggerContainer);
     44    RegisterUnloadableClass(MultiTriggerContainer);
    4545
    4646    /**
     
    5050        The creator.
    5151    */
    52     MultiTriggerContainer::MultiTriggerContainer(BaseObject* creator) : BaseObject(creator), originator_(NULL), data_(NULL)
     52    MultiTriggerContainer::MultiTriggerContainer(Context* context) : BaseObject(context), originator_(NULL), data_(NULL)
    5353    {
    5454        RegisterObject(MultiTriggerContainer);
     
    6565        A pointer to the data that should be sent with the container.
    6666    */
    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)
    6868    {
    6969        RegisterObject(MultiTriggerContainer);
  • code/trunk/src/modules/objects/triggers/MultiTriggerContainer.h

    r7601 r9667  
    5858
    5959        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.
    6262            virtual ~MultiTriggerContainer(); //!< Destructor.
    6363
  • code/trunk/src/modules/objects/triggers/Trigger.cc

    r8706 r9667  
    4747    SetConsoleCommand("Trigger", "debugFlares", &Trigger::debugFlares).defaultValues(false);
    4848
    49     CreateFactory(Trigger);
     49    RegisterClass(Trigger);
    5050
    5151    /**
     
    5555        The creator of the Trigger.
    5656    */
    57     Trigger::Trigger(BaseObject* creator) : TriggerBase(creator)
     57    Trigger::Trigger(Context* context) : TriggerBase(context)
    5858    {
    5959        RegisterObject(Trigger);
  • code/trunk/src/modules/objects/triggers/Trigger.h

    r8213 r9667  
    8080    {
    8181        public:
    82             Trigger(BaseObject* creator); // Constructor. Registers and initializes the object.
     82            Trigger(Context* context); // Constructor. Registers and initializes the object.
    8383            virtual ~Trigger();
    8484
  • code/trunk/src/modules/objects/triggers/TriggerBase.cc

    r8858 r9667  
    4646    /*static*/ const std::string TriggerBase::xor_s = "xor";
    4747
    48     CreateFactory(TriggerBase);
     48    RegisterClass(TriggerBase);
    4949
    5050    /**
     
    5252        Constructor. Registers the object and initializes some values.
    5353    */
    54     TriggerBase::TriggerBase(BaseObject* creator) : StaticEntity(creator)
     54    TriggerBase::TriggerBase(Context* context) : StaticEntity(context)
    5555    {
    5656        RegisterObject(TriggerBase);
  • code/trunk/src/modules/objects/triggers/TriggerBase.h

    r8706 r9667  
    7474    {
    7575        public:
    76             TriggerBase(BaseObject* creator);
     76            TriggerBase(Context* context);
    7777            virtual ~TriggerBase();
    7878
  • code/trunk/src/modules/overlays/FadeoutText.cc

    r5929 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(FadeoutText);
     38    RegisterClass(FadeoutText);
    3939
    40     FadeoutText::FadeoutText(BaseObject* creator) : OverlayText(creator)
     40    FadeoutText::FadeoutText(Context* context) : OverlayText(context)
    4141    {
    4242        RegisterObject(FadeoutText);
  • code/trunk/src/modules/overlays/FadeoutText.h

    r7401 r9667  
    4141    {
    4242        public:
    43             FadeoutText(BaseObject* creator);
     43            FadeoutText(Context* context);
    4444            virtual ~FadeoutText() {}
    4545
  • code/trunk/src/modules/overlays/GUIOverlay.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(GUIOverlay);
     43    RegisterClass(GUIOverlay);
    4444
    45     GUIOverlay::GUIOverlay(BaseObject* creator) : OrxonoxOverlay(creator)
     45    GUIOverlay::GUIOverlay(Context* context) : OrxonoxOverlay(context)
    4646    {
    4747        RegisterObject(GUIOverlay);
  • code/trunk/src/modules/overlays/GUIOverlay.h

    r7401 r9667  
    4141        public:
    4242
    43             GUIOverlay(BaseObject* creator);
     43            GUIOverlay(Context* context);
    4444            virtual ~GUIOverlay();
    4545
  • code/trunk/src/modules/overlays/OverlayText.cc

    r7401 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(OverlayText);
     43    RegisterClass(OverlayText);
    4444
    4545    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left);
     
    4747    BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right);
    4848
    49     OverlayText::OverlayText(BaseObject* creator)
    50         : OrxonoxOverlay(creator)
     49    OverlayText::OverlayText(Context* context)
     50        : OrxonoxOverlay(context)
    5151    {
    5252        RegisterObject(OverlayText);
  • code/trunk/src/modules/overlays/OverlayText.h

    r7401 r9667  
    4949        };
    5050
    51         OverlayText(BaseObject* creator);
     51        OverlayText(Context* context);
    5252        virtual ~OverlayText();
    5353
  • code/trunk/src/modules/overlays/debugging/DebugFPSText.cc

    r5781 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(DebugFPSText);
     37    RegisterClass(DebugFPSText);
    3838
    39     DebugFPSText::DebugFPSText(BaseObject* creator) : OverlayText(creator)
     39    DebugFPSText::DebugFPSText(Context* context) : OverlayText(context)
    4040    {
    4141        RegisterObject(DebugFPSText);
  • code/trunk/src/modules/overlays/debugging/DebugFPSText.h

    r5781 r9667  
    4040    {
    4141    public:
    42         DebugFPSText(BaseObject* creator);
     42        DebugFPSText(Context* context);
    4343        virtual ~DebugFPSText();
    4444
  • code/trunk/src/modules/overlays/debugging/DebugRTRText.cc

    r5781 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(DebugRTRText);
     37    RegisterClass(DebugRTRText);
    3838
    39     DebugRTRText::DebugRTRText(BaseObject* creator) : OverlayText(creator)
     39    DebugRTRText::DebugRTRText(Context* context) : OverlayText(context)
    4040    {
    4141        RegisterObject(DebugRTRText);
  • code/trunk/src/modules/overlays/debugging/DebugRTRText.h

    r5781 r9667  
    4040    {
    4141    public:
    42         DebugRTRText(BaseObject* creator);
     42        DebugRTRText(Context* context);
    4343        virtual ~DebugRTRText();
    4444
  • code/trunk/src/modules/overlays/hud/AnnounceMessage.cc

    r5781 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(AnnounceMessage);
     36    RegisterClass(AnnounceMessage);
    3737
    38     AnnounceMessage::AnnounceMessage(BaseObject* creator) : FadeoutText(creator)
     38    AnnounceMessage::AnnounceMessage(Context* context) : FadeoutText(context)
    3939    {
    4040        RegisterObject(AnnounceMessage);
  • code/trunk/src/modules/overlays/hud/AnnounceMessage.h

    r5781 r9667  
    4040    {
    4141        public:
    42             AnnounceMessage(BaseObject* creator);
     42            AnnounceMessage(Context* context);
    4343            virtual ~AnnounceMessage() {}
    4444
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r8858 r9667  
    3535#include "util/DisplayStringConversions.h"
    3636#include "core/CoreIncludes.h"
    37 #include "core/ConfigValueIncludes.h"
     37#include "core/config/ConfigValueIncludes.h"
    3838#include "core/command/Executor.h"
    3939
     
    4444namespace orxonox
    4545{
    46     CreateFactory(ChatOverlay);
     46    RegisterClass(ChatOverlay);
    4747
    48     ChatOverlay::ChatOverlay(BaseObject* creator)
    49         : OverlayText(creator)
     48    ChatOverlay::ChatOverlay(Context* context)
     49        : OverlayText(context)
    5050    {
    5151        RegisterObject(ChatOverlay);
  • code/trunk/src/modules/overlays/hud/ChatOverlay.h

    r8858 r9667  
    4343    {
    4444        public:
    45             ChatOverlay(BaseObject* creator);
     45            ChatOverlay(Context* context);
    4646            virtual ~ChatOverlay();
    4747
  • code/trunk/src/modules/overlays/hud/DeathMessage.cc

    r5781 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(DeathMessage);
     36    RegisterClass(DeathMessage);
    3737
    38     DeathMessage::DeathMessage(BaseObject* creator) : FadeoutText(creator)
     38    DeathMessage::DeathMessage(Context* context) : FadeoutText(context)
    3939    {
    4040        RegisterObject(DeathMessage);
  • code/trunk/src/modules/overlays/hud/DeathMessage.h

    r5781 r9667  
    4040    {
    4141        public:
    42             DeathMessage(BaseObject* creator);
     42            DeathMessage(Context* context);
    4343            virtual ~DeathMessage() {}
    4444
  • code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc

    r7163 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(GametypeFadingMessage);
     36    RegisterClass(GametypeFadingMessage);
    3737
    38     GametypeFadingMessage::GametypeFadingMessage(BaseObject* creator) : FadeoutText(creator)
     38    GametypeFadingMessage::GametypeFadingMessage(Context* context) : FadeoutText(context)
    3939    {
    4040        RegisterObject(GametypeFadingMessage);
  • code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h

    r8729 r9667  
    4040    {
    4141        public:
    42             GametypeFadingMessage(BaseObject* creator);
     42            GametypeFadingMessage(Context* context);
    4343            virtual ~GametypeFadingMessage();
    4444
  • code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc

    r7163 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(GametypeStaticMessage);
     38    RegisterClass(GametypeStaticMessage);
    3939
    4040
    41     GametypeStaticMessage::GametypeStaticMessage(BaseObject* creator) : OverlayText(creator)
     41    GametypeStaticMessage::GametypeStaticMessage(Context* context) : OverlayText(context)
    4242    {
    4343        RegisterObject(GametypeStaticMessage);
  • code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h

    r7163 r9667  
    4343    {
    4444        public:
    45             GametypeStaticMessage(BaseObject* creator);
     45            GametypeStaticMessage(Context* context);
    4646            virtual ~GametypeStaticMessage();
    4747
  • code/trunk/src/modules/overlays/hud/HUDBar.cc

    r8706 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(BarColour);
    48 
    49     BarColour::BarColour(BaseObject* creator)
    50         : BaseObject(creator)
     47    RegisterClass(BarColour);
     48
     49    BarColour::BarColour(Context* context)
     50        : BaseObject(context)
    5151    {
    5252        RegisterObject(BarColour);
     
    6767    unsigned int HUDBar::materialcount_s = 0;
    6868
    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)
    7173    {
    7274        RegisterObject(HUDBar);
  • code/trunk/src/modules/overlays/hud/HUDBar.h

    r8706 r9667  
    4848    {
    4949    public:
    50         BarColour(BaseObject* creator);
     50        BarColour(Context* context);
    5151        virtual ~BarColour() { }
    5252
     
    6868    {
    6969    public:
    70         HUDBar(BaseObject* creator);
     70        HUDBar(Context* context);
    7171        virtual ~HUDBar();
    7272
  • code/trunk/src/modules/overlays/hud/HUDBoostBar.cc

    r9348 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(HUDBoostBar);
     37    RegisterClass(HUDBoostBar);
    3838
    39     HUDBoostBar::HUDBoostBar(BaseObject* creator)
    40         : HUDBar(creator)
     39    HUDBoostBar::HUDBoostBar(Context* context)
     40        : HUDBar(context)
    4141    {
    4242        RegisterObject(HUDBoostBar);
  • code/trunk/src/modules/overlays/hud/HUDBoostBar.h

    r9348 r9667  
    4040    {
    4141    public:
    42         HUDBoostBar(BaseObject* creator);
     42        HUDBoostBar(Context* context);
    4343        virtual ~HUDBoostBar();
    4444
  • code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc

    r9348 r9667  
    2929#include "HUDEnemyHealthBar.h"
    3030
    31 #include "core/ConfigValueIncludes.h"
     31#include "core/config/ConfigValueIncludes.h"
    3232#include "worldentities/pawns/Pawn.h"
    3333
    3434namespace orxonox
    3535{
    36     CreateFactory(HUDEnemyHealthBar);
     36    RegisterClass(HUDEnemyHealthBar);
    3737
    38     HUDEnemyHealthBar::HUDEnemyHealthBar(BaseObject* creator) : HUDHealthBar(creator)
     38    HUDEnemyHealthBar::HUDEnemyHealthBar(Context* context) : HUDHealthBar(context)
    3939    {
    4040        RegisterObject(HUDEnemyHealthBar);
  • code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h

    r9348 r9667  
    3737    {
    3838        public:
    39             HUDEnemyHealthBar(BaseObject* creator);
     39            HUDEnemyHealthBar(Context* context);
    4040            virtual ~HUDEnemyHealthBar();
    4141
  • code/trunk/src/modules/overlays/hud/HUDHealthBar.cc

    r6054 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(HUDHealthBar);
     39    RegisterClass(HUDHealthBar);
    4040
    41     HUDHealthBar::HUDHealthBar(BaseObject* creator) : HUDBar(creator)
     41    HUDHealthBar::HUDHealthBar(Context* context) : HUDBar(context)
    4242    {
    4343        RegisterObject(HUDHealthBar);
     
    4646        this->bUseBarColour_ = false;
    4747
    48         this->textoverlay_ = new OverlayText(this);
     48        this->textoverlay_ = new OverlayText(this->getContext());
    4949
    5050        assert(this->textoverlay_.get());
  • code/trunk/src/modules/overlays/hud/HUDHealthBar.h

    r9259 r9667  
    4242    {
    4343        public:
    44             HUDHealthBar(BaseObject* creator);
     44            HUDHealthBar(Context* context);
    4545            virtual ~HUDHealthBar();
    4646
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r9526 r9667  
    5151#include "worldentities/pawns/Pawn.h"
    5252#include "worldentities/WorldEntity.h"
    53 #include "core/ConfigValueIncludes.h"
     53#include "core/config/ConfigValueIncludes.h"
    5454#include "tools/TextureGenerator.h"
    5555// #include <boost/bind/bind_template.hpp>
     
    6767        return a.second < b.second;
    6868    }
    69     CreateFactory ( HUDNavigation );
     69    RegisterClass ( HUDNavigation );
    7070
    7171    HUDNavigation* HUDNavigation::localHUD_s = 0;
    7272
    73     HUDNavigation::HUDNavigation(BaseObject* creator) :
    74         OrxonoxOverlay(creator)
     73    HUDNavigation::HUDNavigation(Context* context) :
     74        OrxonoxOverlay(context)
    7575    {
    7676        RegisterObject(HUDNavigation)
  • code/trunk/src/modules/overlays/hud/HUDNavigation.h

    r9526 r9667  
    4646    {
    4747        public:
    48             HUDNavigation(BaseObject* creator);
     48            HUDNavigation(Context* context);
    4949            virtual ~HUDNavigation();
    5050
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r9348 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(HUDRadar);
    47 
    48     HUDRadar::HUDRadar(BaseObject* creator)
    49         : OrxonoxOverlay(creator)
     46    RegisterClass(HUDRadar);
     47
     48    HUDRadar::HUDRadar(Context* context)
     49        : OrxonoxOverlay(context)
    5050    {
    5151        RegisterObject(HUDRadar);
  • code/trunk/src/modules/overlays/hud/HUDRadar.h

    r8891 r9667  
    4646    {
    4747    public:
    48         HUDRadar(BaseObject* creator);
     48        HUDRadar(Context* context);
    4949        virtual ~HUDRadar();
    5050
  • code/trunk/src/modules/overlays/hud/HUDSpeedBar.cc

    r8706 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(HUDSpeedBar);
     38    RegisterClass(HUDSpeedBar);
    3939
    40     HUDSpeedBar::HUDSpeedBar(BaseObject* creator)
    41         : HUDBar(creator)
     40    HUDSpeedBar::HUDSpeedBar(Context* context)
     41        : HUDBar(context)
    4242    {
    4343        RegisterObject(HUDSpeedBar);
  • code/trunk/src/modules/overlays/hud/HUDSpeedBar.h

    r5781 r9667  
    4141    {
    4242    public:
    43         HUDSpeedBar(BaseObject* creator);
     43        HUDSpeedBar(Context* context);
    4444        virtual ~HUDSpeedBar();
    4545
  • code/trunk/src/modules/overlays/hud/HUDTimer.cc

    r5781 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(HUDTimer);
     38    RegisterClass(HUDTimer);
    3939
    40     HUDTimer::HUDTimer(BaseObject* creator) : OverlayText(creator)
     40    HUDTimer::HUDTimer(Context* context) : OverlayText(context)
    4141    {
    4242        RegisterObject(HUDTimer);
  • code/trunk/src/modules/overlays/hud/HUDTimer.h

    r5781 r9667  
    4040    {
    4141    public:
    42         HUDTimer(BaseObject* creator);
     42        HUDTimer(Context* context);
    4343        virtual ~HUDTimer();
    4444
  • code/trunk/src/modules/overlays/hud/KillMessage.cc

    r5781 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(KillMessage);
     36    RegisterClass(KillMessage);
    3737
    38     KillMessage::KillMessage(BaseObject* creator) : FadeoutText(creator)
     38    KillMessage::KillMessage(Context* context) : FadeoutText(context)
    3939    {
    4040        RegisterObject(KillMessage);
  • code/trunk/src/modules/overlays/hud/KillMessage.h

    r5781 r9667  
    4040    {
    4141        public:
    42             KillMessage(BaseObject* creator);
     42            KillMessage(Context* context);
    4343            virtual ~KillMessage() {}
    4444
  • code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc

    r7655 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(LastManStandingInfos);
     39    RegisterClass(LastManStandingInfos);
    4040
    41     LastManStandingInfos::LastManStandingInfos(BaseObject* creator) : OverlayText(creator)
     41    LastManStandingInfos::LastManStandingInfos(Context* context) : OverlayText(context)
    4242    {
    4343        RegisterObject(LastManStandingInfos);
  • code/trunk/src/modules/overlays/hud/LastManStandingInfos.h

    r7655 r9667  
    4040    {
    4141        public:
    42             LastManStandingInfos(BaseObject* creator);
     42            LastManStandingInfos(Context* context);
    4343            virtual ~LastManStandingInfos();
    4444
  • code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc

    r8351 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(LastTeamStandingInfos);
     39    RegisterClass(LastTeamStandingInfos);
    4040
    41     LastTeamStandingInfos::LastTeamStandingInfos(BaseObject* creator) : OverlayText(creator)
     41    LastTeamStandingInfos::LastTeamStandingInfos(Context* context) : OverlayText(context)
    4242    {
    4343        RegisterObject(LastTeamStandingInfos);
  • code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.h

    r8178 r9667  
    4040    {
    4141        public:
    42             LastTeamStandingInfos(BaseObject* creator);
     42            LastTeamStandingInfos(Context* context);
    4343            virtual ~LastTeamStandingInfos();
    4444
  • code/trunk/src/modules/overlays/hud/PauseNotice.cc

    r8079 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(PauseNotice);
     36    RegisterClass(PauseNotice);
    3737
    38     PauseNotice::PauseNotice(BaseObject* creator) : OverlayText(creator)
     38    PauseNotice::PauseNotice(Context* context) : OverlayText(context)
    3939    {
    4040        RegisterObject(PauseNotice);
  • code/trunk/src/modules/overlays/hud/PauseNotice.h

    r8079 r9667  
    4040    {
    4141        public:
    42             PauseNotice(BaseObject* creator);
     42            PauseNotice(Context* context);
    4343
    4444            virtual void changedOwner();
  • code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc

    r6417 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(TeamBaseMatchScore);
     39    RegisterClass(TeamBaseMatchScore);
    4040
    41     TeamBaseMatchScore::TeamBaseMatchScore(BaseObject* creator) : OverlayText(creator)
     41    TeamBaseMatchScore::TeamBaseMatchScore(Context* context) : OverlayText(context)
    4242    {
    4343        RegisterObject(TeamBaseMatchScore);
  • code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.h

    r5781 r9667  
    4040    {
    4141        public:
    42             TeamBaseMatchScore(BaseObject* creator);
     42            TeamBaseMatchScore(Context* context);
    4343            virtual ~TeamBaseMatchScore();
    4444
  • code/trunk/src/modules/overlays/stats/Scoreboard.cc

    r7401 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(Scoreboard);
     37    RegisterClass(Scoreboard);
    3838
    3939    /**
    4040        @brief Constructor: Creates the scoreboard.
    4141    */
    42     Scoreboard::Scoreboard(BaseObject* creator)
    43         : OrxonoxOverlay(creator)
     42    Scoreboard::Scoreboard(Context* context)
     43        : OrxonoxOverlay(context)
    4444    {
    4545        RegisterObject(Scoreboard);
  • code/trunk/src/modules/overlays/stats/Scoreboard.h

    r7401 r9667  
    4141    {
    4242    public: // functions
    43         Scoreboard(BaseObject* creator);
     43        Scoreboard(Context* context);
    4444        virtual ~Scoreboard();
    4545
  • code/trunk/src/modules/overlays/stats/Stats.cc

    r7401 r9667  
    3535#include "util/StringUtils.h"
    3636#include "core/CoreIncludes.h"
    37 #include "core/ConfigValueIncludes.h"
     37#include "core/config/ConfigValueIncludes.h"
    3838
    3939namespace orxonox
    4040{
    41     CreateFactory(Stats);
     41    RegisterClass(Stats);
    4242
    4343    /**
    4444        @brief Constructor: Creates and initializes the Stats panel.
    4545    */
    46     Stats::Stats(BaseObject* creator)
    47         : OrxonoxOverlay(creator)
     46    Stats::Stats(Context* context)
     47        : OrxonoxOverlay(context)
    4848        , statsOverlayNoise_(0)
    4949        , statsOverlayBorder_(0)
  • code/trunk/src/modules/overlays/stats/Stats.h

    r7401 r9667  
    4141    {
    4242    public: // functions
    43         Stats(BaseObject* creator);
     43        Stats(Context* context);
    4444        virtual ~Stats();
    4545
  • code/trunk/src/modules/pickup/CollectiblePickup.cc

    r9348 r9667  
    3838#include "PickupCollection.h"
    3939
    40 namespace orxonox {
     40namespace orxonox
     41{
     42    RegisterAbstractClass(CollectiblePickup).inheritsFrom(Class(Pickupable));
    4143
    4244    /**
  • code/trunk/src/modules/pickup/Pickup.cc

    r9348 r9667  
    4848    /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
    4949
    50     CreateUnloadableFactory(Pickup);
     50    RegisterUnloadableClass(Pickup);
    5151
    5252    /**
     
    5656        The objects creator.
    5757    */
    58     Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
     58    Pickup::Pickup(Context* context) : BaseObject(context)
    5959    {
    6060        RegisterObject(Pickup);
     
    187187    bool Pickup::createSpawner(void)
    188188    {
    189         PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
     189        PickupSpawner::createDroppedPickup(this->getContext(), this, this->getCarrier());
    190190        return true;
    191191    }
  • code/trunk/src/modules/pickup/Pickup.h

    r9348 r9667  
    100100
    101101        public:
    102             Pickup(BaseObject* creator); //!< Constructor.
     102            Pickup(Context* context); //!< Constructor.
    103103            virtual ~Pickup(); //!< Destructor.
    104104
  • code/trunk/src/modules/pickup/PickupCollection.cc

    r9348 r9667  
    4545{
    4646
    47     CreateFactory(PickupCollection);
     47    RegisterClass(PickupCollection);
    4848
    4949    /**
     
    5353        The creator of the object.
    5454    */
    55     PickupCollection::PickupCollection(BaseObject* creator) : BaseObject(creator)
     55    PickupCollection::PickupCollection(Context* context) : BaseObject(context)
    5656    {
    5757        RegisterObject(PickupCollection);
     
    328328    bool PickupCollection::createSpawner(void)
    329329    {
    330         PickupSpawner::createDroppedPickup(this, this, this->getCarrier());
     330        PickupSpawner::createDroppedPickup(this->getContext(), this, this->getCarrier());
    331331        return true;
    332332    }
  • code/trunk/src/modules/pickup/PickupCollection.h

    r9348 r9667  
    7070
    7171        public:
    72             PickupCollection(BaseObject* creator); //!< Default Constructor.
     72            PickupCollection(Context* context); //!< Default Constructor.
    7373            virtual ~PickupCollection(); //!< Destructor.
    7474
  • code/trunk/src/modules/pickup/PickupManager.cc

    r9348 r9667  
    3737#include "core/LuaState.h"
    3838#include "core/GUIManager.h"
    39 #include "core/Identifier.h"
     39#include "core/class/Identifier.h"
    4040#include "network/Host.h"
    4141#include "network/NetworkFunction.h"
  • code/trunk/src/modules/pickup/PickupManager.h

    r9348 r9667  
    3939
    4040#include <map>
    41 #include "core/WeakPtr.h"
     41#include "core/object/WeakPtr.h"
    4242
    4343#include "PickupRepresentation.h"
  • code/trunk/src/modules/pickup/PickupRepresentation.cc

    r9348 r9667  
    4545{
    4646
    47     CreateFactory(PickupRepresentation);
     47    RegisterClass(PickupRepresentation);
    4848
    4949    /**
     
    6464        Default Constructor. Registers the object and initializes its member variables.
    6565    */
    66     PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), spawnerRepresentation_(NULL)
     66    PickupRepresentation::PickupRepresentation(Context* context) : BaseObject(context), Synchronisable(context), spawnerRepresentation_(NULL)
    6767    {
    6868        RegisterObject(PickupRepresentation);
     
    180180    StaticEntity* PickupRepresentation::getDefaultSpawnerRepresentation(PickupSpawner* spawner)
    181181    {
    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());
    184184        sphere->setColour(ColourValue(0.95f, 0.85f, 0.27f));
    185185        sphere->setMaterial("Sphere2");
    186186        sphere->setScale(0.1f);
    187         Billboard* icon = new Billboard(spawner);
     187        Billboard* icon = new Billboard(spawner->getContext());
    188188        icon->setColour(ColourValue(0.89f, 0.79f, 0.08f));
    189189        icon->setMaterial("asterisk");
  • code/trunk/src/modules/pickup/PickupRepresentation.h

    r9348 r9667  
    9595        public:
    9696            PickupRepresentation(); //!< Constructor
    97             PickupRepresentation(BaseObject* creator); //!< Default constructor.
     97            PickupRepresentation(Context* context); //!< Default constructor.
    9898            virtual ~PickupRepresentation(); //!< Destructor.
    9999
  • code/trunk/src/modules/pickup/PickupSpawner.cc

    r9348 r9667  
    4747{
    4848
    49     CreateFactory(PickupSpawner);
     49    RegisterClass(PickupSpawner);
    5050
    5151    /**
     
    5555        Pointer to the object which created this item.
    5656    */
    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)
    5858    {
    5959        RegisterObject(PickupSpawner);
     
    9999        The distance at which the PickupSpawner will trigger.
    100100    */
    101     /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance)
    102     {
    103         PickupSpawner* spawner = new PickupSpawner(creator);
     101    /*static*/ PickupSpawner* PickupSpawner::createDroppedPickup(Context* context, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance)
     102    {
     103        PickupSpawner* spawner = new PickupSpawner(context);
    104104
    105105        spawner->setPickupable(pickup);
     
    289289            if (identifier != NULL)
    290290            {
    291                 Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this));
     291                Pickupable* pickup = orxonox_cast<Pickupable*>(identifier->fabricate(this->getContext()));
    292292                orxonox_cast<BaseObject*>(pickup)->addTemplate(this->pickupTemplate_);
    293293                return pickup;
  • code/trunk/src/modules/pickup/PickupSpawner.h

    r9348 r9667  
    7777    {
    7878        public:
    79             PickupSpawner(BaseObject* creator); //!< Default Constructor.
     79            PickupSpawner(Context* context); //!< Default Constructor.
    8080            virtual ~PickupSpawner(); //!< Destructor.
    8181
    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);
    8383
    8484            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  
    4242namespace orxonox
    4343{
    44     CreateFactory(DamageBoostPickup);
     44    RegisterClass(DamageBoostPickup);
    4545
    4646    /**
     
    4848        Constructor. Registers the object and initializes the member variables.
    4949    */
    50     DamageBoostPickup::DamageBoostPickup(BaseObject* creator) : Pickup(creator)
     50    DamageBoostPickup::DamageBoostPickup(Context* context) : Pickup(context)
    5151    {
    5252        RegisterObject(DamageBoostPickup);
  • code/trunk/src/modules/pickup/items/DamageBoostPickup.h

    r9348 r9667  
    4949        public:
    5050
    51             DamageBoostPickup(BaseObject* creator); //!< Constructor.
     51            DamageBoostPickup(Context* context); //!< Constructor.
    5252            virtual ~DamageBoostPickup(); //!< Destructor.
    5353
  • code/trunk/src/modules/pickup/items/DronePickup.cc

    r9348 r9667  
    4545{
    4646
    47     CreateFactory(DronePickup);
     47    RegisterClass(DronePickup);
    4848
    4949    /**
     
    5151        Constructor. Registers the object and initializes the member variables.
    5252    */
    53     DronePickup::DronePickup(BaseObject* creator) : Pickup(creator)
     53    DronePickup::DronePickup(Context* context) : Pickup(context)
    5454    {
    5555        RegisterObject(DronePickup);
     
    126126
    127127                //Attach to pawn
    128                 Drone* drone = new Drone(pawn->getCreator()); // 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)
    129129                drone->addTemplate(this->getDroneTemplate());
    130130
  • code/trunk/src/modules/pickup/items/DronePickup.h

    r9348 r9667  
    6464        public:
    6565
    66             DronePickup(BaseObject* creator); //!< Constructor.
     66            DronePickup(Context* context); //!< Constructor.
    6767            virtual ~DronePickup(); //!< Destructor.
    6868
  • code/trunk/src/modules/pickup/items/HealthPickup.cc

    r9348 r9667  
    4747    /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent";
    4848
    49     CreateFactory(HealthPickup);
     49    RegisterClass(HealthPickup);
    5050
    5151    /**
     
    5353        Constructor. Registers the object and initializes the member variables.
    5454    */
    55     HealthPickup::HealthPickup(BaseObject* creator) : Pickup(creator)
     55    HealthPickup::HealthPickup(Context* context) : Pickup(context)
    5656    {
    5757        RegisterObject(HealthPickup);
  • code/trunk/src/modules/pickup/items/HealthPickup.h

    r9348 r9667  
    9090        public:
    9191
    92             HealthPickup(BaseObject* creator); //!< Constructor.
     92            HealthPickup(Context* context); //!< Constructor.
    9393            virtual ~HealthPickup(); //!< Destructor.
    9494
  • code/trunk/src/modules/pickup/items/InvisiblePickup.cc

    r9348 r9667  
    4545{
    4646
    47     CreateFactory(InvisiblePickup);
     47    RegisterClass(InvisiblePickup);
    4848
    4949    /**
     
    5151        Constructor. Registers the object and initializes the member variables.
    5252    */
    53     InvisiblePickup::InvisiblePickup(BaseObject* creator) : Pickup(creator)
     53    InvisiblePickup::InvisiblePickup(Context* context) : Pickup(context)
    5454    {
    5555        RegisterObject(InvisiblePickup);
  • code/trunk/src/modules/pickup/items/InvisiblePickup.h

    r9348 r9667  
    7070        public:
    7171
    72             InvisiblePickup(BaseObject* creator); //!< Constructor.
     72            InvisiblePickup(Context* context); //!< Constructor.
    7373            virtual ~InvisiblePickup(); //!< Destructor.
    7474
  • code/trunk/src/modules/pickup/items/MetaPickup.cc

    r9348 r9667  
    4242namespace orxonox {
    4343
    44     CreateFactory(MetaPickup);
     44    RegisterClass(MetaPickup);
    4545
    4646    //! Setting the static variables to their values.
     
    5555        Constructor. Registers and initializes the object.
    5656    */
    57     MetaPickup::MetaPickup(BaseObject* creator) : Pickup(creator)
     57    MetaPickup::MetaPickup(Context* context) : Pickup(context)
    5858    {
    5959        RegisterObject(MetaPickup);
  • code/trunk/src/modules/pickup/items/MetaPickup.h

    r9348 r9667  
    8989
    9090        public:
    91             MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     91            MetaPickup(Context* context); //!< Constructor. Registers and initializes the object.
    9292            virtual ~MetaPickup(); //!< Destructor.
    9393
  • code/trunk/src/modules/pickup/items/ShieldPickup.cc

    r9348 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(ShieldPickup);
     44    RegisterClass(ShieldPickup);
    4545
    4646    /**
     
    4848        Constructor. Registers the object and initializes the member variables.
    4949    */
    50     ShieldPickup::ShieldPickup(BaseObject* creator) : Pickup(creator)
     50    ShieldPickup::ShieldPickup(Context* context) : Pickup(context)
    5151    {
    5252        RegisterObject(ShieldPickup);
  • code/trunk/src/modules/pickup/items/ShieldPickup.h

    r9348 r9667  
    7676        public:
    7777
    78             ShieldPickup(BaseObject* creator); //!< Constructor.
     78            ShieldPickup(Context* context); //!< Constructor.
    7979            virtual ~ShieldPickup(); //!< Destructor.
    8080
  • code/trunk/src/modules/pickup/items/ShrinkPickup.cc

    r9348 r9667  
    4646namespace orxonox
    4747{
    48     CreateFactory(ShrinkPickup);
     48    RegisterClass(ShrinkPickup);
    4949
    5050    /**
     
    5252        Constructor: Initializes the Pickup.
    5353    */
    54     ShrinkPickup::ShrinkPickup(BaseObject* creator) : Pickup(creator)
     54    ShrinkPickup::ShrinkPickup(Context* context) : Pickup(context)
    5555    {
    5656        RegisterObject(ShrinkPickup);
  • code/trunk/src/modules/pickup/items/ShrinkPickup.h

    r9348 r9667  
    7272    {
    7373        public:
    74             ShrinkPickup(BaseObject* creator); // Constructor.
     74            ShrinkPickup(Context* context); // Constructor.
    7575            virtual ~ShrinkPickup(); // Destructor.
    7676
  • code/trunk/src/modules/pickup/items/SpeedPickup.cc

    r9348 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(SpeedPickup);
     44    RegisterClass(SpeedPickup);
    4545
    4646    /**
     
    4848        Constructor. Registers the object and initializes the member variables.
    4949    */
    50     SpeedPickup::SpeedPickup(BaseObject* creator) : Pickup(creator)
     50    SpeedPickup::SpeedPickup(Context* context) : Pickup(context)
    5151    {
    5252        RegisterObject(SpeedPickup);
  • code/trunk/src/modules/pickup/items/SpeedPickup.h

    r9348 r9667  
    7575        public:
    7676
    77             SpeedPickup(BaseObject* creator); //!< Constructor.
     77            SpeedPickup(Context* context); //!< Constructor.
    7878            virtual ~SpeedPickup(); //!< Destructor.
    7979
  • code/trunk/src/modules/pong/Pong.cc

    r9348 r9667  
    3737#include "core/EventIncludes.h"
    3838#include "core/command/Executor.h"
    39 #include "core/ConfigValueIncludes.h"
     39#include "core/config/ConfigValueIncludes.h"
    4040
    4141#include "gamestates/GSLevel.h"
     
    5353    CreateEventName(PongCenterpoint, left);
    5454
    55     CreateUnloadableFactory(Pong);
     55    RegisterUnloadableClass(Pong);
    5656
    5757    /**
     
    5959        Constructor. Registers and initializes the object.
    6060    */
    61     Pong::Pong(BaseObject* creator) : Deathmatch(creator)
     61    Pong::Pong(Context* context) : Deathmatch(context)
    6262    {
    6363        RegisterObject(Pong);
     
    129129            if (this->ball_ == NULL) // If there is no ball, create a new ball.
    130130            {
    131                 this->ball_ = new PongBall(this->center_);
     131                this->ball_ = new PongBall(this->center_->getContext());
    132132                // Apply the template for the ball specified by the centerpoint.
    133133                this->ball_->addTemplate(this->center_->getBalltemplate());
     
    147147                if (this->bat_[i] == NULL)
    148148                {
    149                     this->bat_[i] = new PongBat(this->center_);
     149                    this->bat_[i] = new PongBat(this->center_->getContext());
    150150                    this->bat_[i]->addTemplate(this->center_->getBattemplate());
    151151                }
  • code/trunk/src/modules/pong/Pong.h

    r9348 r9667  
    6565    {
    6666        public:
    67             Pong(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     67            Pong(Context* context); //!< Constructor. Registers and initializes the object.
    6868            virtual ~Pong(); //!< Destructor. Cleans up, if initialized.
    6969
  • code/trunk/src/modules/pong/PongAI.cc

    r8952 r9667  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/ConfigValueIncludes.h"
     37#include "core/config/ConfigValueIncludes.h"
    3838#include "core/command/Executor.h"
    3939#include "tools/Timer.h"
     
    4545namespace orxonox
    4646{
    47     CreateUnloadableFactory(PongAI);
     47    RegisterUnloadableClass(PongAI);
    4848
    4949    const static float MAX_REACTION_TIME = 0.4f;
     
    5353        Constructor. Registers and initializes the object.
    5454    */
    55     PongAI::PongAI(BaseObject* creator) : Controller(creator)
     55    PongAI::PongAI(Context* context) : Controller(context)
    5656    {
    5757        RegisterObject(PongAI);
  • code/trunk/src/modules/pong/PongAI.h

    r9016 r9667  
    4444
    4545#include "controllers/Controller.h"
     46#include "PongBall.h"
    4647
    4748namespace orxonox
     
    6061    {
    6162        public:
    62             PongAI(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     63            PongAI(Context* context); //!< Constructor. Registers and initializes the object.
    6364            virtual ~PongAI();
    6465
  • code/trunk/src/modules/pong/PongBall.cc

    r8108 r9667  
    4343namespace orxonox
    4444{
    45     CreateFactory(PongBall);
     45    RegisterClass(PongBall);
    4646
    4747    const float PongBall::MAX_REL_Z_VELOCITY = 1.5;
     
    5151        Constructor. Registers and initializes the object.
    5252    */
    53     PongBall::PongBall(BaseObject* creator)
    54         : MovableEntity(creator)
     53    PongBall::PongBall(Context* context)
     54        : MovableEntity(context)
    5555    {
    5656        RegisterObject(PongBall);
  • code/trunk/src/modules/pong/PongBall.h

    r8108 r9667  
    5959    {
    6060        public:
    61             PongBall(BaseObject* creator);
     61            PongBall(Context* context);
    6262            virtual ~PongBall();
    6363
  • code/trunk/src/modules/pong/PongBat.cc

    r8108 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(PongBat);
     41    RegisterClass(PongBat);
    4242
    4343    /**
     
    4545        Constructor. Registers and initializes the object.
    4646    */
    47     PongBat::PongBat(BaseObject* creator) : ControllableEntity(creator)
     47    PongBat::PongBat(Context* context) : ControllableEntity(context)
    4848    {
    4949        RegisterObject(PongBat);
  • code/trunk/src/modules/pong/PongBat.h

    r8706 r9667  
    5757    {
    5858        public:
    59             PongBat(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     59            PongBat(Context* context); //!< Constructor. Registers and initializes the object.
    6060            virtual ~PongBat() {}
    6161
  • code/trunk/src/modules/pong/PongBot.cc

    r8108 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(PongBot);
     41    RegisterClass(PongBot);
    4242
    4343    /**
     
    4545        Constructor. Registers the object and creates a PongAI controller.
    4646    */
    47     PongBot::PongBot(BaseObject* creator) : Bot(creator)
     47    PongBot::PongBot(Context* context) : Bot(context)
    4848    {
    4949        RegisterObject(PongBot);
  • code/trunk/src/modules/pong/PongBot.h

    r8108 r9667  
    5656    {
    5757        public:
    58             PongBot(BaseObject* creator);
     58            PongBot(Context* context);
    5959            virtual ~PongBot() {}
    6060    };
  • code/trunk/src/modules/pong/PongCenterpoint.cc

    r8108 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(PongCenterpoint);
     43    RegisterClass(PongCenterpoint);
    4444
    4545    /**
     
    4747        Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
    4848    */
    49     PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator)
     49    PongCenterpoint::PongCenterpoint(Context* context) : StaticEntity(context)
    5050    {
    5151        RegisterObject(PongCenterpoint);
  • code/trunk/src/modules/pong/PongCenterpoint.h

    r8108 r9667  
    121121    {
    122122        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.
    124124            virtual ~PongCenterpoint() {}
    125125
  • code/trunk/src/modules/pong/PongScore.cc

    r9264 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(PongScore);
     46    RegisterClass(PongScore);
    4747
    4848    /**
     
    5050        Constructor. Registers and initializes the object.
    5151    */
    52     PongScore::PongScore(BaseObject* creator) : OverlayText(creator)
     52    PongScore::PongScore(Context* context) : OverlayText(context)
    5353    {
    5454        RegisterObject(PongScore);
  • code/trunk/src/modules/pong/PongScore.h

    r9258 r9667  
    5757    {
    5858        public:
    59             PongScore(BaseObject* creator);
     59            PongScore(Context* context);
    6060            virtual ~PongScore();
    6161
  • code/trunk/src/modules/portals/PortalEndPoint.cc

    r9526 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(PortalEndPoint);
     44    RegisterClass(PortalEndPoint);
    4545
    4646    /*static*/ const std::string PortalEndPoint::EVENTFUNCTIONNAME = "execute";
     
    4848    std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
    4949
    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)
    5151    {
    5252        RegisterObject(PortalEndPoint);
    5353
    54         this->trigger_ = new DistanceMultiTrigger(this);
     54        this->trigger_ = new DistanceMultiTrigger(this->getContext());
    5555        this->trigger_->setName("portal");
    5656        this->attach(this->trigger_);
     
    6161        if( GameMode::isMaster() )
    6262        {
    63             this->portalSound_ = new WorldSound(this);
     63            this->portalSound_ = new WorldSound(this->getContext());
    6464            this->portalSound_->setLooping(false);
    6565            this->attach(this->portalSound_);
  • code/trunk/src/modules/portals/PortalEndPoint.h

    r9526 r9667  
    6060    {
    6161        public:
    62             PortalEndPoint(BaseObject* creator);
     62            PortalEndPoint(Context* context);
    6363            virtual ~PortalEndPoint();
    6464
  • code/trunk/src/modules/portals/PortalLink.cc

    r8767 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(PortalLink);
     38    RegisterClass(PortalLink);
    3939
    4040    std::map<PortalEndPoint *, PortalEndPoint *> PortalLink::links_s;
    4141
    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)
    4343    {
    4444        RegisterObject(PortalLink);
  • code/trunk/src/modules/portals/PortalLink.h

    r8767 r9667  
    5454    {
    5555        public:
    56             PortalLink(BaseObject* creator);
     56            PortalLink(Context* context);
    5757            virtual ~PortalLink();
    5858            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/modules/questsystem/GlobalQuest.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(GlobalQuest);
     43    RegisterClass(GlobalQuest);
    4444
    4545    /**
     
    4747        Constructor. Registers the object.
    4848    */
    49     GlobalQuest::GlobalQuest(BaseObject* creator) : Quest(creator)
     49    GlobalQuest::GlobalQuest(Context* context) : Quest(context)
    5050    {
    5151        RegisterObject(GlobalQuest);
  • code/trunk/src/modules/questsystem/GlobalQuest.h

    r7552 r9667  
    9090    {
    9191        public:
    92             GlobalQuest(BaseObject* creator);
     92            GlobalQuest(Context* context);
    9393            virtual ~GlobalQuest();
    9494
  • code/trunk/src/modules/questsystem/LocalQuest.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(LocalQuest);
     43    RegisterClass(LocalQuest);
    4444
    4545    /**
     
    4747        Constructor. Registers and initializes the object.
    4848    */
    49     LocalQuest::LocalQuest(BaseObject* creator) : Quest(creator)
     49    LocalQuest::LocalQuest(Context* context) : Quest(context)
    5050    {
    5151        RegisterObject(LocalQuest);
  • code/trunk/src/modules/questsystem/LocalQuest.h

    r7552 r9667  
    8484    {
    8585        public:
    86             LocalQuest(BaseObject* creator);
     86            LocalQuest(Context* context);
    8787            virtual ~LocalQuest();
    8888
  • code/trunk/src/modules/questsystem/Quest.cc

    r8858 r9667  
    4545namespace orxonox
    4646{
     47    RegisterAbstractClass(Quest).inheritsFrom(Class(QuestItem));
     48
    4749    /**
    4850    @brief
    4951        Constructor. Registers and initializes object.
    5052    */
    51     Quest::Quest(BaseObject* creator) : QuestItem(creator)
     53    Quest::Quest(Context* context) : QuestItem(context)
    5254    {
    5355        RegisterObject(Quest);
  • code/trunk/src/modules/questsystem/Quest.h

    r7552 r9667  
    8282    { // tolua_export
    8383        public:
    84             Quest(BaseObject* creator);
     84            Quest(Context* context);
    8585            virtual ~Quest();
    8686
  • code/trunk/src/modules/questsystem/QuestDescription.cc

    r8858 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(QuestDescription);
     46    RegisterClass(QuestDescription);
    4747
    4848    /*static*/ const std::string QuestDescription::SENDER = "questsystem";
     
    5252        Constructor. Registers and initializes the object.
    5353    */
    54     QuestDescription::QuestDescription(BaseObject* creator) : BaseObject(creator)
     54    QuestDescription::QuestDescription(Context* context) : BaseObject(context)
    5555    {
    5656        RegisterObject(QuestDescription);
  • code/trunk/src/modules/questsystem/QuestDescription.h

    r7552 r9667  
    6464// tolua_end
    6565        public:
    66             QuestDescription(BaseObject* creator);
     66            QuestDescription(Context* context);
    6767            virtual ~QuestDescription();
    6868
  • code/trunk/src/modules/questsystem/QuestEffect.cc

    r8858 r9667  
    3737namespace orxonox
    3838{
     39    RegisterAbstractClass(QuestEffect).inheritsFrom(Class(BaseObject));
     40
    3941    /**
    4042    @brief
     
    4244        Is not meant to be invoked directly, since this is only an interface.
    4345    */
    44     QuestEffect::QuestEffect(BaseObject* creator) : BaseObject(creator)
     46    QuestEffect::QuestEffect(Context* context) : BaseObject(context)
    4547    {
    4648        RegisterObject(QuestEffect);
  • code/trunk/src/modules/questsystem/QuestEffect.h

    r7552 r9667  
    5757    {
    5858        public:
    59             QuestEffect(BaseObject* creator);
     59            QuestEffect(Context* context);
    6060            virtual ~QuestEffect();
    6161
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.cc

    r8858 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(QuestEffectBeacon);
     47    RegisterClass(QuestEffectBeacon);
    4848
    4949    /**
     
    5151        Constructor. Registers the object and initializes defaults.
    5252    */
    53     QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : StaticEntity(creator)
     53    QuestEffectBeacon::QuestEffectBeacon(Context* context) : StaticEntity(context)
    5454    {
    5555        RegisterObject(QuestEffectBeacon);
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.h

    r7552 r9667  
    9393    {
    9494        public:
    95             QuestEffectBeacon(BaseObject* creator);
     95            QuestEffectBeacon(Context* context);
    9696            virtual ~QuestEffectBeacon();
    9797
  • code/trunk/src/modules/questsystem/QuestHint.cc

    r8858 r9667  
    4343namespace orxonox
    4444{
    45     CreateFactory(QuestHint);
     45    RegisterClass(QuestHint);
    4646
    4747    /**
     
    4949        Constructor. Registers the object.
    5050    */
    51     QuestHint::QuestHint(BaseObject* creator) : QuestItem(creator)
     51    QuestHint::QuestHint(Context* context) : QuestItem(context)
    5252    {
    5353        RegisterObject(QuestHint);
  • code/trunk/src/modules/questsystem/QuestHint.h

    r7552 r9667  
    8282
    8383        public:
    84             QuestHint(BaseObject* creator);
     84            QuestHint(Context* context);
    8585            virtual ~QuestHint();
    8686
  • code/trunk/src/modules/questsystem/QuestItem.cc

    r8858 r9667  
    4242{
    4343
    44     CreateUnloadableFactory(QuestItem);
     44    RegisterUnloadableClass(QuestItem);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     QuestItem::QuestItem(BaseObject* creator) : BaseObject(creator)
     50    QuestItem::QuestItem(Context* context) : BaseObject(context)
    5151    {
    5252        this->registered_ = false;
  • code/trunk/src/modules/questsystem/QuestItem.h

    r8891 r9667  
    6060
    6161        public:
    62             QuestItem(BaseObject* creator);
     62            QuestItem(Context* context);
    6363            virtual ~QuestItem();
    6464
  • code/trunk/src/modules/questsystem/QuestListener.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(QuestListener);
     44    RegisterClass(QuestListener);
    4545
    4646    // Initialization of the static variables for the modes as strings.
     
    5454        Constructor. Registers the object and initializes variables.
    5555    */
    56     QuestListener::QuestListener(BaseObject* creator) : BaseObject(creator)
     56    QuestListener::QuestListener(Context* context) : BaseObject(context)
    5757    {
    5858        RegisterObject(QuestListener);
  • code/trunk/src/modules/questsystem/QuestListener.h

    r7552 r9667  
    8787
    8888        public:
    89             QuestListener(BaseObject* creator);
     89            QuestListener(Context* context);
    9090            virtual ~QuestListener();
    9191
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r8952 r9667  
    3838#include "util/ScopedSingletonManager.h"
    3939#include "core/command/ConsoleCommand.h"
    40 #include "core/CoreIncludes.h"
    4140#include "core/GUIManager.h"
    4241#include "core/LuaState.h"
     
    6059    QuestManager::QuestManager()
    6160    {
    62         RegisterRootObject(QuestManager);
    6361        orxout(internal_info, context::quests) << "QuestManager created." << endl;
    6462    }
  • code/trunk/src/modules/questsystem/QuestManager.h

    r8706 r9667  
    4343
    4444#include "util/Singleton.h"
    45 #include "core/OrxonoxClass.h"
    4645
    4746namespace orxonox  // tolua_export
     
    5958    */
    6059    class _QuestsystemExport QuestManager  // tolua_export
    61         : public Singleton<QuestManager>, public orxonox::OrxonoxClass
     60        : public Singleton<QuestManager>
    6261    { // tolua_export
    6362
  • code/trunk/src/modules/questsystem/effects/AddQuest.cc

    r8858 r9667  
    4343namespace orxonox
    4444{
    45     CreateFactory(AddQuest);
     45    RegisterClass(AddQuest);
    4646
    4747    /**
     
    4949        Constructor. Registers the object.
    5050    */
    51     AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator)
     51    AddQuest::AddQuest(Context* context) : ChangeQuestStatus(context)
    5252    {
    5353        RegisterObject(AddQuest);
  • code/trunk/src/modules/questsystem/effects/AddQuest.h

    r7552 r9667  
    5959    {
    6060        public:
    61         AddQuest(BaseObject* creator);
     61        AddQuest(Context* context);
    6262        virtual ~AddQuest();
    6363
  • code/trunk/src/modules/questsystem/effects/AddQuestHint.cc

    r8858 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(AddQuestHint);
     46    RegisterClass(AddQuestHint);
    4747
    4848    /**
     
    5050        Constructor. Registers the object.
    5151    */
    52     AddQuestHint::AddQuestHint(BaseObject* creator) : QuestEffect(creator)
     52    AddQuestHint::AddQuestHint(Context* context) : QuestEffect(context)
    5353    {
    5454        RegisterObject(AddQuestHint);
  • code/trunk/src/modules/questsystem/effects/AddQuestHint.h

    r7552 r9667  
    6161    {
    6262        public:
    63             AddQuestHint(BaseObject* creator);
     63            AddQuestHint(Context* context);
    6464            virtual ~AddQuestHint();
    6565
  • code/trunk/src/modules/questsystem/effects/AddReward.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(AddReward);
     43    RegisterClass(AddReward);
    4444
    4545    /**
     
    4747        Constructor. Registers the object.
    4848    */
    49     AddReward::AddReward(BaseObject* creator) : QuestEffect(creator)
     49    AddReward::AddReward(Context* context) : QuestEffect(context)
    5050    {
    5151        RegisterObject(AddReward);
  • code/trunk/src/modules/questsystem/effects/AddReward.h

    r7552 r9667  
    6565    {
    6666        public:
    67             AddReward(BaseObject* creator);
     67            AddReward(Context* context);
    6868            virtual ~AddReward();
    6969
  • code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
     44    RegisterAbstractClass(ChangeQuestStatus).inheritsFrom(Class(QuestEffect));
     45
    4446    /**
    4547    @brief
    4648        Constructor. Registers the object.
    4749    */
    48     ChangeQuestStatus::ChangeQuestStatus(BaseObject* creator) : QuestEffect(creator)
     50    ChangeQuestStatus::ChangeQuestStatus(Context* context) : QuestEffect(context)
    4951    {
    5052        RegisterObject(ChangeQuestStatus);
  • code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h

    r7552 r9667  
    5656    {
    5757        public:
    58             ChangeQuestStatus(BaseObject* creator);
     58            ChangeQuestStatus(Context* context);
    5959            virtual ~ChangeQuestStatus();
    6060
  • code/trunk/src/modules/questsystem/effects/CompleteQuest.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(CompleteQuest);
     44    RegisterClass(CompleteQuest);
    4545
    4646    /**
     
    4848        Constructor. Registers the object.
    4949    */
    50     CompleteQuest::CompleteQuest(BaseObject* creator) : ChangeQuestStatus(creator)
     50    CompleteQuest::CompleteQuest(Context* context) : ChangeQuestStatus(context)
    5151    {
    5252        RegisterObject(CompleteQuest);
  • code/trunk/src/modules/questsystem/effects/CompleteQuest.h

    r7552 r9667  
    5959    {
    6060        public:
    61             CompleteQuest(BaseObject* creator);
     61            CompleteQuest(Context* context);
    6262            virtual ~CompleteQuest();
    6363
  • code/trunk/src/modules/questsystem/effects/FailQuest.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(FailQuest);
     44    RegisterClass(FailQuest);
    4545
    4646    /**
     
    4848        Constructor. Registers the object.
    4949    */
    50     FailQuest::FailQuest(BaseObject* creator) : ChangeQuestStatus(creator)
     50    FailQuest::FailQuest(Context* context) : ChangeQuestStatus(context)
    5151    {
    5252        RegisterObject(FailQuest);
  • code/trunk/src/modules/questsystem/effects/FailQuest.h

    r7552 r9667  
    5959    {
    6060        public:
    61             FailQuest(BaseObject* creator);
     61            FailQuest(Context* context);
    6262            virtual ~FailQuest();
    6363
  • code/trunk/src/modules/tetris/Tetris.cc

    r9348 r9667  
    5454{
    5555
    56     CreateUnloadableFactory(Tetris);
     56    RegisterUnloadableClass(Tetris);
    5757
    5858    /**
     
    6161    @ingroup Tetris
    6262    */
    63     Tetris::Tetris(BaseObject* creator) : Deathmatch(creator)
     63    Tetris::Tetris(Context* context) : Deathmatch(context)
    6464    {
    6565        RegisterObject(Tetris);
     
    379379    {
    380380        // create new futureBrick_
    381         this->futureBrick_ = new TetrisBrick(this->center_);
     381        this->futureBrick_ = new TetrisBrick(this->center_->getContext());
    382382
    383383
  • code/trunk/src/modules/tetris/Tetris.h

    r9348 r9667  
    5555    {
    5656        public:
    57             Tetris(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     57            Tetris(Context* context); //!< Constructor. Registers and initializes the object.
    5858            virtual ~Tetris(); //!< Destructor. Cleans up, if initialized.
    5959
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r9348 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(TetrisBrick);
     46    RegisterClass(TetrisBrick);
    4747
    4848    /**
     
    5151    @ingroup Tetris
    5252    */
    53     TetrisBrick::TetrisBrick(BaseObject* creator): ControllableEntity(creator)
     53    TetrisBrick::TetrisBrick(Context* context): ControllableEntity(context)
    5454    {
    5555        RegisterObject(TetrisBrick);
     
    7777        {
    7878            // Create a new stone and add it to the brick.
    79             TetrisStone* stone = new TetrisStone(this);
     79            TetrisStone* stone = new TetrisStone(this->getContext());
    8080            this->brickStones_.push_back(stone);
    8181            this->attach(stone);
  • code/trunk/src/modules/tetris/TetrisBrick.h

    r9348 r9667  
    5454    {
    5555        public:
    56             TetrisBrick(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     56            TetrisBrick(Context* context); //!< Constructor. Registers and initializes the object.
    5757            virtual ~TetrisBrick() {}
    5858
  • code/trunk/src/modules/tetris/TetrisCenterpoint.cc

    r9348 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(TetrisCenterpoint);
     44    RegisterClass(TetrisCenterpoint);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object and checks whether the gametype is actually Tetris.
    4949    */
    50     TetrisCenterpoint::TetrisCenterpoint(BaseObject* creator) : StaticEntity(creator)
     50    TetrisCenterpoint::TetrisCenterpoint(Context* context) : StaticEntity(context)
    5151    {
    5252        RegisterObject(TetrisCenterpoint);
  • code/trunk/src/modules/tetris/TetrisCenterpoint.h

    r9348 r9667  
    5959    {
    6060        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.
    6262            virtual ~TetrisCenterpoint() {}
    6363
  • code/trunk/src/modules/tetris/TetrisScore.cc

    r9348 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(TetrisScore);
     47    RegisterClass(TetrisScore);
    4848
    4949    /**
     
    5252    @ingroup Tetris
    5353    */
    54     TetrisScore::TetrisScore(BaseObject* creator) : OverlayText(creator)
     54    TetrisScore::TetrisScore(Context* context) : OverlayText(context)
    5555    {
    5656        RegisterObject(TetrisScore);
  • code/trunk/src/modules/tetris/TetrisScore.h

    r9348 r9667  
    5757    {
    5858        public:
    59             TetrisScore(BaseObject* creator);
     59            TetrisScore(Context* context);
    6060            virtual ~TetrisScore();
    6161
  • code/trunk/src/modules/tetris/TetrisStone.cc

    r9348 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(TetrisStone);
     44    RegisterClass(TetrisStone);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     TetrisStone::TetrisStone(BaseObject* creator) : MovableEntity(creator)
     50    TetrisStone::TetrisStone(Context* context) : MovableEntity(context)
    5151    {
    5252        RegisterObject(TetrisStone);
  • code/trunk/src/modules/tetris/TetrisStone.h

    r9348 r9667  
    5454    {
    5555        public:
    56             TetrisStone(BaseObject* creator); //!< Constructor. Registers and initializes the object.
     56            TetrisStone(Context* context); //!< Constructor. Registers and initializes the object.
    5757            virtual ~TetrisStone() {}
    5858
  • code/trunk/src/modules/towerdefense/Tower.cc

    r9272 r9667  
    1616namespace orxonox
    1717{
    18     CreateFactory(Tower);
     18    RegisterClass(Tower);
    1919
    2020    /**
     
    2222        Constructor. Registers and initializes the object.
    2323    */
    24     Tower::Tower(BaseObject* creator) : Pawn(creator)
     24    Tower::Tower(Context* context) : Pawn(context)
    2525    {
    2626        RegisterObject(Tower);
  • code/trunk/src/modules/towerdefense/Tower.h

    r9272 r9667  
    2727    {
    2828    public:
    29         Tower(BaseObject* creator);
     29        Tower(Context* context);
    3030        virtual ~Tower() {};
    3131
  • code/trunk/src/modules/towerdefense/TowerDefense.cc

    r9347 r9667  
    8787
    8888#include "chat/ChatManager.h"
     89#include "core/CoreIncludes.h"
    8990
    9091/* Part of a temporary hack to allow the player to add towers */
     
    9394namespace orxonox
    9495{
    95     CreateUnloadableFactory(TowerDefense);
    96 
    97     TowerDefense::TowerDefense(BaseObject* creator) : Deathmatch(creator)
     96    RegisterUnloadableClass(TowerDefense);
     97
     98    TowerDefense::TowerDefense(Context* context) : Deathmatch(context)
    9899    {
    99100        RegisterObject(TowerDefense);
     
    189190
    190191        // Create tower
    191         Tower* newTower = new Tower(this->center_);
     192        Tower* newTower = new Tower(this->center_->getContext());
    192193        newTower->addTemplate(this->center_->getTowerTemplate());
    193194
  • code/trunk/src/modules/towerdefense/TowerDefense.h

    r9347 r9667  
    4848    {
    4949    public:
    50         TowerDefense(BaseObject* creator);
     50        TowerDefense(Context* context);
    5151        virtual ~TowerDefense();
    5252
  • code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc

    r9272 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(TowerDefenseCenterpoint);
     43    RegisterClass(TowerDefenseCenterpoint);
    4444
    4545    /**
     
    4747        Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
    4848    */
    49     TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : MobileEntity(creator)
     49    TowerDefenseCenterpoint::TowerDefenseCenterpoint(Context* context) : MobileEntity(context)
    5050    {
    5151        RegisterObject(TowerDefenseCenterpoint);
  • code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h

    r9272 r9667  
    4949    {
    5050        public:
    51             TowerDefenseCenterpoint(BaseObject* creator);
     51            TowerDefenseCenterpoint(Context* context);
    5252            virtual ~TowerDefenseCenterpoint() {}
    5353
  • code/trunk/src/modules/towerdefense/TowerDefenseController.cc

    r9271 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(TowerDefenseController);
     38    RegisterClass(TowerDefenseController);
    3939
    40     TowerDefenseController::TowerDefenseController(BaseObject* creator) : WaypointController(creator)
     40    TowerDefenseController::TowerDefenseController(Context* context) : WaypointController(context)
    4141    {
    4242        RegisterObject(TowerDefenseController);
  • code/trunk/src/modules/towerdefense/TowerDefenseController.h

    r9271 r9667  
    4040    {
    4141        public:
    42             TowerDefenseController(BaseObject* creator);
     42            TowerDefenseController(Context* context);
    4343            virtual ~TowerDefenseController() {}
    4444
  • code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc

    r9272 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(TowerDefenseHUDController);
     37    RegisterClass(TowerDefenseHUDController);
    3838
    39     TowerDefenseHUDController::TowerDefenseHUDController(BaseObject* creator) : OverlayText(creator)
     39    TowerDefenseHUDController::TowerDefenseHUDController(Context* context) : OverlayText(context)
    4040    {
    4141        RegisterObject(TowerDefenseHUDController);
  • code/trunk/src/modules/towerdefense/TowerDefenseHUDController.h

    r9272 r9667  
    4949    {
    5050    public:
    51         TowerDefenseHUDController(BaseObject* creator);
     51        TowerDefenseHUDController(Context* context);
    5252        virtual ~TowerDefenseHUDController();
    5353
  • code/trunk/src/modules/weapons/MuzzleFlash.cc

    r8855 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(MuzzleFlash);
     41    RegisterClass(MuzzleFlash);
    4242
    43     MuzzleFlash::MuzzleFlash(BaseObject* creator) : Billboard(creator)
     43    MuzzleFlash::MuzzleFlash(Context* context) : Billboard(context)
    4444    {
    4545        RegisterObject(MuzzleFlash);
  • code/trunk/src/modules/weapons/MuzzleFlash.h

    r8855 r9667  
    5555    {
    5656        public:
    57             MuzzleFlash(BaseObject* creator);
     57            MuzzleFlash(Context* context);
    5858            virtual ~MuzzleFlash() {}
    5959
  • code/trunk/src/modules/weapons/RocketController.cc

    r9348 r9667  
    4545        Constructor.
    4646    */
    47     RocketController::RocketController(BaseObject* creator) : Controller(creator)
     47    RocketController::RocketController(Context* context) : Controller(context)
    4848    {
    4949        RegisterObject(RocketController);
     
    5151
    5252        // Create a rocket for the controller.
    53         this->rocket_ = new SimpleRocket(this);
     53        this->rocket_ = new SimpleRocket(this->getContext());
    5454        this->rocket_->setController(this);
    5555        this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_));
  • code/trunk/src/modules/weapons/RocketController.h

    r8855 r9667  
    5252    {
    5353        public:
    54             RocketController(BaseObject* creator);
     54            RocketController(Context* context);
    5555            virtual ~RocketController();
    5656
  • code/trunk/src/modules/weapons/munitions/FusionMunition.cc

    r8855 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(FusionMunition);
     39    RegisterClass(FusionMunition);
    4040
    41     FusionMunition::FusionMunition(BaseObject* creator) : Munition(creator)
     41    FusionMunition::FusionMunition(Context* context) : Munition(context)
    4242    {
    4343        RegisterObject(FusionMunition);
  • code/trunk/src/modules/weapons/munitions/FusionMunition.h

    r8855 r9667  
    5151    {
    5252        public:
    53             FusionMunition(BaseObject* creator);
     53            FusionMunition(Context* context);
    5454            virtual ~FusionMunition() {}
    5555    };
  • code/trunk/src/modules/weapons/munitions/LaserMunition.cc

    r8855 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(LaserMunition);
     39    RegisterClass(LaserMunition);
    4040
    41     LaserMunition::LaserMunition(BaseObject* creator) : ReplenishingMunition(creator)
     41    LaserMunition::LaserMunition(Context* context) : ReplenishingMunition(context)
    4242    {
    4343        RegisterObject(LaserMunition);
  • code/trunk/src/modules/weapons/munitions/LaserMunition.h

    r8855 r9667  
    5151    {
    5252        public:
    53             LaserMunition(BaseObject* creator);
     53            LaserMunition(Context* context);
    5454            virtual ~LaserMunition() {}
    5555    };
  • code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc

    r8855 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(ReplenishingMunition);
     41    RegisterClass(ReplenishingMunition);
    4242
    43     ReplenishingMunition::ReplenishingMunition(BaseObject* creator) : Munition(creator)
     43    ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context)
    4444    {
    4545        RegisterObject(ReplenishingMunition);
  • code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h

    r8855 r9667  
    5353    {
    5454        public:
    55             ReplenishingMunition(BaseObject* creator);
     55            ReplenishingMunition(Context* context);
    5656            virtual ~ReplenishingMunition() {}
    5757
  • code/trunk/src/modules/weapons/munitions/RocketMunition.cc

    r8855 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(RocketMunition);
     39    RegisterClass(RocketMunition);
    4040
    41     RocketMunition::RocketMunition(BaseObject* creator) : Munition(creator)
     41    RocketMunition::RocketMunition(Context* context) : Munition(context)
    4242    {
    4343        RegisterObject(RocketMunition);
  • code/trunk/src/modules/weapons/munitions/RocketMunition.h

    r8855 r9667  
    5151    {
    5252        public:
    53             RocketMunition(BaseObject* creator);
     53            RocketMunition(Context* context);
    5454            virtual ~RocketMunition() {}
    5555    };
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc

    r8855 r9667  
    4242namespace orxonox
    4343{
     44    RegisterClassNoArgs(BasicProjectile);
     45
    4446    /**
    4547    @brief
    4648        Constructor. Registers the object and initializes some default values.
    4749    */
    48     BasicProjectile::BasicProjectile() : OrxonoxClass()
     50    BasicProjectile::BasicProjectile()
    4951    {
    50         RegisterRootObject(BasicProjectile);// Register the BasicProjectile class to the core
     52        RegisterObject(BasicProjectile);// Register the BasicProjectile class to the core
    5153
    5254        this->bDestroy_ = false;
     
    106108                {
    107109                    {
    108                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     110                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    109111                        effect->setPosition(entity->getPosition());
    110112                        effect->setOrientation(entity->getOrientation());
     
    115117                    // Second effect with same condition
    116118                    {
    117                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     119                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    118120                        effect->setPosition(entity->getPosition());
    119121                        effect->setOrientation(entity->getOrientation());
     
    127129                if (victim && victim->hasShield() && (this->getDamage() > 0.0f || this->getShieldDamage() > 0.0f) && victim->getHealth() > 0.0f)
    128130                {
    129                     ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     131                    ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    130132                    effect->setDestroyAfterLife(true);
    131133                    effect->setSource("Orxonox/Shield");
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.h

    r8858 r9667  
    3939#include "worldentities/pawns/Pawn.h"
    4040
    41 #include "core/OrxonoxClass.h"
     41#include "core/class/OrxonoxInterface.h"
    4242
    4343namespace orxonox
     
    5252    @ingroup WeaponsProjectiles
    5353    */
    54     class _WeaponsExport BasicProjectile : public virtual OrxonoxClass
     54    class _WeaponsExport BasicProjectile : public virtual OrxonoxInterface
    5555    {
    5656        public:
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc

    r8855 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(BillboardProjectile);
     42    RegisterClass(BillboardProjectile);
    4343
    44     BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
     44    BillboardProjectile::BillboardProjectile(Context* context) : Projectile(context)
    4545    {
    4646        RegisterObject(BillboardProjectile);
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h

    r8855 r9667  
    5555    {
    5656        public:
    57             BillboardProjectile(BaseObject* creator);
     57            BillboardProjectile(Context* context);
    5858            virtual ~BillboardProjectile();
    5959
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r8855 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(LightningGunProjectile);
     42    RegisterClass(LightningGunProjectile);
    4343
    44     LightningGunProjectile::LightningGunProjectile(BaseObject* creator) : BillboardProjectile(creator)
     44    LightningGunProjectile::LightningGunProjectile(Context* context) : BillboardProjectile(context)
    4545    {
    4646        RegisterObject(LightningGunProjectile);
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h

    r8855 r9667  
    5555    {
    5656        public:
    57             LightningGunProjectile(BaseObject* creator);
     57            LightningGunProjectile(Context* context);
    5858            virtual ~LightningGunProjectile() {}
    5959
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc

    r8855 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(ParticleProjectile);
     43    RegisterClass(ParticleProjectile);
    4444
    45     ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
     45    ParticleProjectile::ParticleProjectile(Context* context) : BillboardProjectile(context)
    4646    {
    4747        RegisterObject(ParticleProjectile);
     
    6565        {
    6666            this->detachOgreObject(this->particles_->getParticleSystem());
    67             this->particles_->destroy();
     67            delete this->particles_;
    6868        }
    6969    }
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h

    r8855 r9667  
    5151    {
    5252        public:
    53             ParticleProjectile(BaseObject* creator);
     53            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    5555            virtual void changedVisibility();
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r8855 r9667  
    3434#include "Projectile.h"
    3535
    36 #include "core/ConfigValueIncludes.h"
     36#include "core/config/ConfigValueIncludes.h"
    3737#include "core/CoreIncludes.h"
    3838#include "core/GameMode.h"
     
    4444namespace orxonox
    4545{
    46     CreateFactory(Projectile);
     46    RegisterClass(Projectile);
    4747
    48     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile()
     48    Projectile::Projectile(Context* context) : MovableEntity(context), BasicProjectile()
    4949    {
    5050        RegisterObject(Projectile);
     
    6060            this->setCollisionType(Kinematic);
    6161
    62             SphereCollisionShape* shape = new SphereCollisionShape(this);
     62            SphereCollisionShape* shape = new SphereCollisionShape(this->getContext());
    6363            shape->setRadius(20.0f);
    6464            this->attachCollisionShape(shape);
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r8855 r9667  
    5858    {
    5959        public:
    60             Projectile(BaseObject* creator);
     60            Projectile(Context* context);
    6161            virtual ~Projectile();
    6262
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r9016 r9667  
    5151namespace orxonox
    5252{
    53     CreateFactory(Rocket);
     53    RegisterClass(Rocket);
    5454
    5555    /**
     
    5757        Constructor. Registers the object and initializes some default values.
    5858    */
    59     Rocket::Rocket(BaseObject* creator)
    60         : ControllableEntity(creator)
     59    Rocket::Rocket(Context* context)
     60        : ControllableEntity(context)
    6161        , BasicProjectile()
    62         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     62        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6363    {
    6464        RegisterObject(Rocket);// Register the Rocket class to the core
     
    7373
    7474            // Create rocket model
    75             Model* model = new Model(this);
     75            Model* model = new Model(this->getContext());
    7676            model->setMeshSource("rocket.mesh");
    7777            model->scale(0.7f);
     
    7979
    8080            // Add effects.
    81             ParticleEmitter* fire = new ParticleEmitter(this);
     81            ParticleEmitter* fire = new ParticleEmitter(this->getContext());
    8282            this->attach(fire);
    8383            fire->setOrientation(this->getOrientation());
     
    8989
    9090            // Add collision shape
    91             ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
     91            ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext());
    9292            collisionShape->setRadius(3);
    9393            collisionShape->setHeight(500);
     
    9797
    9898            // Add sound
    99             this->defSndWpnEngine_ = new WorldSound(this);
     99            this->defSndWpnEngine_ = new WorldSound(this->getContext());
    100100            this->defSndWpnEngine_->setLooping(true);
    101101            this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
     
    103103            this->attach(defSndWpnEngine_);
    104104
    105             this->defSndWpnLaunch_ = new WorldSound(this);
     105            this->defSndWpnLaunch_ = new WorldSound(this->getContext());
    106106            this->defSndWpnLaunch_->setLooping(false);
    107107            this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
     
    116116
    117117        // Add camera
    118         CameraPosition* camPosition = new CameraPosition(this);
     118        CameraPosition* camPosition = new CameraPosition(this->getContext());
    119119        camPosition->setPosition(0,4,15);
    120120        camPosition->setAllowMouseLook(true);
     
    226226        if(this->getShooter())
    227227        {
    228             effect1 = new ParticleSpawner(this->getShooter()->getCreator());
    229             effect2 = new ParticleSpawner(this->getShooter()->getCreator());
     228            effect1 = new ParticleSpawner(this->getShooter()->getContext());
     229            effect2 = new ParticleSpawner(this->getShooter()->getContext());
    230230        }
    231231        else
    232232        {
    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());
    235235        }
    236236
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r9016 r9667  
    5959    {
    6060        public:
    61             Rocket(BaseObject* creator);
     61            Rocket(Context* context);
    6262            virtual ~Rocket();
    6363
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r8859 r9667  
    5252namespace orxonox
    5353{
    54     CreateFactory(SimpleRocket);
     54    RegisterClass(SimpleRocket);
    5555
    5656    const float SimpleRocket::FUEL_PERCENTAGE = 0.8f;
    5757
    58     SimpleRocket::SimpleRocket(BaseObject* creator)
    59         : ControllableEntity(creator)
     58    SimpleRocket::SimpleRocket(Context* context)
     59        : ControllableEntity(context)
    6060        , BasicProjectile()
    61         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     61        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6262    {
    6363        RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core
     
    7474
    7575            // Create rocket model.
    76             Model* model = new Model(this);
     76            Model* model = new Model(this->getContext());
    7777            model->setMeshSource("rocket.mesh");
    7878            model->scale(0.7f);
     
    8080
    8181            // Add effects.
    82             this->fire_ = new ParticleEmitter(this);
     82            this->fire_ = new ParticleEmitter(this->getContext());
    8383            this->attach(this->fire_);
    8484
     
    9191            // Add collision shape.
    9292            // 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());
    9494            collisionShape->setOrientation(this->getOrientation());
    9595            collisionShape->setRadius(1.5f);
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r8859 r9667  
    6060    {
    6161        public:
    62             SimpleRocket(BaseObject* creator);
     62            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    6464            virtual void tick(float dt);
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r8855 r9667  
    4949namespace orxonox
    5050{
    51     CreateFactory(EnergyDrink);
     51    RegisterClass(EnergyDrink);
    5252
    53     EnergyDrink::EnergyDrink(BaseObject* creator) : WeaponMode(creator)
     53    EnergyDrink::EnergyDrink(Context* context) : WeaponMode(context)
    5454    {
    5555        RegisterObject(EnergyDrink);
     
    101101    {
    102102        // 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());
    105105        model->setMeshSource("can.mesh");
    106106        model->setCastShadows(false);
     
    127127    void EnergyDrink::muzzleflash()
    128128    {
    129         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     129        MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
    130130        this->getWeapon()->attach(muzzleFlash);
    131131        muzzleFlash->setPosition(this->getMuzzleOffset());
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h

    r8855 r9667  
    5454    {
    5555        public:
    56             EnergyDrink(BaseObject* creator);
     56            EnergyDrink(Context* context);
    5757            virtual ~EnergyDrink() {}
    5858
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r8855 r9667  
    4646namespace orxonox
    4747{
    48     CreateFactory(FusionFire);
     48    RegisterClass(FusionFire);
    4949
    50     FusionFire::FusionFire(BaseObject* creator) : WeaponMode(creator)
     50    FusionFire::FusionFire(Context* context) : WeaponMode(context)
    5151    {
    5252        RegisterObject(FusionFire);
     
    6666    void FusionFire::fire()
    6767    {
    68         BillboardProjectile* projectile = new BillboardProjectile(this);
     68        BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
    6969
    7070        projectile->setOrientation(this->getMuzzleOrientation());
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.h

    r8855 r9667  
    5151    {
    5252        public:
    53             FusionFire(BaseObject* creator);
     53            FusionFire(Context* context);
    5454            virtual ~FusionFire() {}
    5555
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r9526 r9667  
    5050namespace orxonox
    5151{
    52     CreateFactory(HsW01);
     52    RegisterClass(HsW01);
    5353
    54     HsW01::HsW01(BaseObject* creator) : WeaponMode(creator)
     54    HsW01::HsW01(Context* context) : WeaponMode(context)
    5555    {
    5656        RegisterObject(HsW01);
     
    111111
    112112        // 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());
    115115        model->setMeshSource(mesh_);
    116116        model->setCastShadows(false);
     
    138138    void HsW01::muzzleflash()
    139139    {
    140         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     140        MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext());
    141141        this->getWeapon()->attach(muzzleFlash);
    142142        muzzleFlash->setPosition(this->getMuzzleOffset());
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r9526 r9667  
    5353    {
    5454        public:
    55             HsW01(BaseObject* creator);
     55            HsW01(Context* context);
    5656            virtual ~HsW01();
    5757
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r8855 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(LaserFire);
     47    RegisterClass(LaserFire);
    4848
    49     LaserFire::LaserFire(BaseObject* creator) : WeaponMode(creator)
     49    LaserFire::LaserFire(Context* context) : WeaponMode(context)
    5050    {
    5151        RegisterObject(LaserFire);
     
    6464    void LaserFire::fire()
    6565    {
    66         ParticleProjectile* projectile = new ParticleProjectile(this);
     66        ParticleProjectile* projectile = new ParticleProjectile(this->getContext());
    6767
    6868        projectile->setOrientation(this->getMuzzleOrientation());
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.h

    r8855 r9667  
    5151    {
    5252        public:
    53             LaserFire(BaseObject* creator);
     53            LaserFire(Context* context);
    5454            virtual ~LaserFire() {}
    5555
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r9016 r9667  
    4444namespace orxonox
    4545{
    46     CreateFactory(LightningGun);
     46    RegisterClass(LightningGun);
    4747
    48     LightningGun::LightningGun(BaseObject* creator) : WeaponMode(creator)
     48    LightningGun::LightningGun(Context* context) : WeaponMode(context)
    4949    {
    5050        RegisterObject(LightningGun);
     
    6868    void LightningGun::fire()
    6969    {
    70         LightningGunProjectile* projectile = new LightningGunProjectile(this);
     70        LightningGunProjectile* projectile = new LightningGunProjectile(this->getContext());
    7171        projectile->setMaterial("Flares/LightningBall_");
    7272
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.h

    r8855 r9667  
    5151    {
    5252        public:
    53             LightningGun(BaseObject* creator);
     53            LightningGun(Context* context);
    5454            virtual ~LightningGun();
    5555
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r8855 r9667  
    4646namespace orxonox
    4747{
    48     CreateFactory(RocketFire);
     48    RegisterClass(RocketFire);
    4949
    50     RocketFire::RocketFire(BaseObject* creator) : WeaponMode(creator)
     50    RocketFire::RocketFire(Context* context) : WeaponMode(context)
    5151    {
    5252        RegisterObject(RocketFire);
     
    7171    void RocketFire::fire()
    7272    {
    73         Rocket* rocket = new Rocket(this);
     73        Rocket* rocket = new Rocket(this->getContext());
    7474
    7575        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.h

    r8855 r9667  
    5151    {
    5252        public:
    53             RocketFire(BaseObject* creator);
     53            RocketFire(Context* context);
    5454            virtual ~RocketFire();
    5555
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r8855 r9667  
    5050{
    5151
    52     CreateFactory(SimpleRocketFire);
     52    RegisterClass(SimpleRocketFire);
    5353
    54     SimpleRocketFire::SimpleRocketFire(BaseObject* creator) : WeaponMode(creator)
     54    SimpleRocketFire::SimpleRocketFire(Context* context) : WeaponMode(context)
    5555    {
    5656        RegisterObject(SimpleRocketFire);
     
    7676    void SimpleRocketFire::fire()
    7777    {
    78         RocketController* controller = new RocketController(this);
     78        RocketController* controller = new RocketController(this->getContext());
    7979        SimpleRocket* rocket = controller->getRocket();
    8080        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h

    r8855 r9667  
    5050    {
    5151        public:
    52             SimpleRocketFire(BaseObject* creator);
     52            SimpleRocketFire(Context* context);
    5353            virtual ~SimpleRocketFire();
    5454            void deactivateFire();
  • code/trunk/src/orxonox/CameraManager.cc

    r9348 r9667  
    3838#include "core/GameMode.h"
    3939#include "core/GraphicsManager.h"
    40 #include "core/ObjectList.h"
     40#include "core/object/ObjectList.h"
    4141#include "tools/Shader.h"
    4242#include "graphics/Camera.h"
     
    4848    CameraManager::CameraManager()
    4949    {
    50         RegisterRootObject(CameraManager);
    51 
    5250        assert(GameMode::showsGraphics());
    5351    }
  • code/trunk/src/orxonox/CameraManager.h

    r8079 r9667  
    4141#include "util/OgreForwardRefs.h"
    4242#include "util/Singleton.h"
    43 #include "core/OrxonoxClass.h"
    4443
    4544namespace orxonox
    4645{
    47     class _OrxonoxExport CameraManager : public Singleton<CameraManager>, public OrxonoxClass
     46    class _OrxonoxExport CameraManager : public Singleton<CameraManager>
    4847    {
    4948            friend class Singleton<CameraManager>;
  • code/trunk/src/orxonox/Level.cc

    r9016 r9667  
    4343namespace orxonox
    4444{
    45     CreateFactory(Level);
     45    RegisterClass(Level);
    4646
    47     Level::Level(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     47    Level::Level(Context* context) : BaseObject(context), Synchronisable(context), Context(context)
    4848    {
    4949        RegisterObject(Level);
  • code/trunk/src/orxonox/Level.h

    r9016 r9667  
    4141namespace orxonox
    4242{
    43     class _OrxonoxExport Level : public BaseObject, public Synchronisable
     43    class _OrxonoxExport Level : public BaseObject, public Synchronisable, public Context
    4444    {
    4545        public:
    46             Level(BaseObject* creator);
     46            Level(Context* context);
    4747            virtual ~Level();
    4848
  • code/trunk/src/orxonox/LevelInfo.cc

    r9348 r9667  
    242242    // LevelInfo
    243243
    244     CreateFactory(LevelInfo);
     244    RegisterClass(LevelInfo);
    245245
    246246    /**
     
    250250        The creator of this object.
    251251    */
    252     LevelInfo::LevelInfo(BaseObject* creator) : BaseObject(creator)
     252    LevelInfo::LevelInfo(Context* context) : BaseObject(context)
    253253    {
    254254        RegisterObject(LevelInfo);
  • code/trunk/src/orxonox/LevelInfo.h

    r9348 r9667  
    4545#include <iostream>
    4646#include <fstream>
    47 #include "core/OrxonoxClass.h"
     47#include "core/class/OrxonoxInterface.h"
    4848
    4949namespace orxonox // tolua_export
     
    6161    */
    6262    class _OrxonoxExport LevelInfoItem // tolua_export
    63         : virtual public OrxonoxClass
     63        : virtual public OrxonoxInterface
    6464    { // tolua_export
    6565        public:
     
    204204    {
    205205        public:
    206             LevelInfo(BaseObject* creator);
     206            LevelInfo(Context* context);
    207207            virtual ~LevelInfo();
    208208
  • code/trunk/src/orxonox/LevelManager.cc

    r9550 r9667  
    3737
    3838#include "util/ScopedSingletonManager.h"
     39#include "core/config/CommandLineParser.h"
     40#include "core/config/ConfigValueIncludes.h"
     41#include "core/CoreIncludes.h"
    3942#include "core/ClassTreeMask.h"
    40 #include "core/CommandLineParser.h"
    41 #include "core/ConfigValueIncludes.h"
    42 #include "core/CoreIncludes.h"
    4343#include "core/Loader.h"
    4444#include "core/Resource.h"
     
    5959    LevelManager::LevelManager()
    6060    {
    61         RegisterRootObject(LevelManager);
     61        RegisterObject(LevelManager);
    6262        this->setConfigValues();
    6363
  • code/trunk/src/orxonox/LevelManager.h

    r8079 r9667  
    4646
    4747#include "util/Singleton.h"
    48 #include "core/OrxonoxClass.h"
     48#include "core/config/Configurable.h"
    4949
    5050// tolua_begin
     
    6767    class _OrxonoxExport LevelManager
    6868    // tolua_end
    69         : public Singleton<LevelManager>, public OrxonoxClass
     69        : public Singleton<LevelManager>, public Configurable
    7070    { // tolua_export
    7171            friend class Singleton<LevelManager>;
  • code/trunk/src/orxonox/Main.cc

    r9550 r9667  
    3636#include "Main.h"
    3737
    38 #include "core/CommandLineParser.h"
     38#include "core/config/CommandLineParser.h"
    3939#include "core/Game.h"
    4040#include "core/LuaState.h"
  • code/trunk/src/orxonox/MoodManager.cc

    r8858 r9667  
    3030
    3131#include "util/ScopedSingletonManager.h"
    32 #include "core/ConfigValueIncludes.h"
     32#include "core/config/ConfigValueIncludes.h"
    3333#include "core/CoreIncludes.h"
    3434#include "core/Resource.h"
     
    4343    MoodManager::MoodManager()
    4444    {
    45         RegisterRootObject(MoodManager);
     45        RegisterObject(MoodManager);
    4646        this->setConfigValues();
    4747
     
    9595    MoodListener::MoodListener()
    9696    {
    97         RegisterRootObject(MoodListener);
     97        RegisterObject(MoodListener);
    9898    }
    9999
  • code/trunk/src/orxonox/MoodManager.h

    r8706 r9667  
    3434#include <string>
    3535#include "util/Singleton.h"
    36 #include "core/OrxonoxClass.h"
     36#include "core/class/OrxonoxInterface.h"
    3737
    3838namespace orxonox
     
    4242        The MoodListener class is aware of a change in themes and directs that info to dependent classes.
    4343    */
    44     class _OrxonoxExport MoodListener : virtual public OrxonoxClass
     44    class _OrxonoxExport MoodListener : virtual public OrxonoxInterface
    4545    {
    4646        friend class MoodManager;
     
    6060        The MoodManager class serves to allow for different musical themes in the game.
    6161    */
    62     class _OrxonoxExport MoodManager : public Singleton<MoodManager>, public OrxonoxClass
     62    class _OrxonoxExport MoodManager : public Singleton<MoodManager>, public Configurable
    6363    {
    6464            friend class Singleton<MoodManager>;
     
    7474
    7575        private:
    76             ~MoodManager() {}
    7776            void checkMoodValidity();
    7877
  • code/trunk/src/orxonox/PawnManager.cc

    r8351 r9667  
    3939    PawnManager::PawnManager()
    4040    {
    41         RegisterRootObject(PawnManager);
     41        RegisterObject(PawnManager);
    4242    }
    4343
  • code/trunk/src/orxonox/PlayerManager.cc

    r8858 r9667  
    4343    PlayerManager::PlayerManager()
    4444    {
    45         RegisterRootObject(PlayerManager);
     45        RegisterObject(PlayerManager);
    4646
    4747//         this->getConnectedClients();
  • code/trunk/src/orxonox/Radar.cc

    r8858 r9667  
    3737
    3838//#include "util/Math.h"
    39 #include "core/ObjectList.h"
     39#include "core/object/ObjectList.h"
    4040#include "core/command/ConsoleCommand.h"
    4141#include "interfaces/RadarListener.h"
  • code/trunk/src/orxonox/Radar.h

    r7163 r9667  
    4141#include <string>
    4242
    43 #include "core/ObjectListIterator.h"
     43#include "core/object/ObjectListIterator.h"
    4444#include "interfaces/RadarViewable.h"
    4545#include "tools/interfaces/Tickable.h"
     
    7474        void radarObjectChanged(RadarViewable* rv);
    7575
    76         ObjectListIterator<RadarViewable> itFocus_;
     76        ObjectList<RadarViewable>::iterator itFocus_;
    7777        RadarViewable* focus_;
    7878        std::map<std::string, RadarViewable::Shape> objectTypes_;
  • code/trunk/src/orxonox/Scene.cc

    r9348 r9667  
    5151namespace orxonox
    5252{
    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)
    5656    {
    5757        RegisterObject(Scene);
  • code/trunk/src/orxonox/Scene.h

    r6417 r9667  
    4545namespace orxonox
    4646{
    47     class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable
     47    class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable, public Context
    4848    {
    4949        public:
    50             Scene(BaseObject* creator);
     50            Scene(Context* context);
    5151            virtual ~Scene();
    5252
  • code/trunk/src/orxonox/Test.cc

    r8858 r9667  
    2828
    2929#include "core/CoreIncludes.h"
    30 #include "core/ConfigValueIncludes.h"
     30#include "core/config/ConfigValueIncludes.h"
    3131#include "core/command/ConsoleCommand.h"
    3232#include "network/NetworkFunction.h"
     
    3636namespace orxonox
    3737{
    38     CreateFactory ( Test );
     38    RegisterClass ( Test );
    3939
    4040    SetConsoleCommand("Test", "printV1", &Test::printV1).addShortcut();
     
    5656    Test* Test::instance_ = 0;
    5757
    58     Test::Test(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     58    Test::Test(Context* context) : BaseObject(context), Synchronisable(context)
    5959    {
    6060        assert(instance_==0);
  • code/trunk/src/orxonox/Test.h

    r8858 r9667  
    4646  {
    4747    public:
    48       Test(BaseObject* creator);
     48      Test(Context* context);
    4949      virtual ~Test();
    5050
  • code/trunk/src/orxonox/chat/ChatHistory.cc

    r8858 r9667  
    3939  /* constructor */
    4040#ifndef CHATTEST
    41   //ChatHistory::ChatHistory( BaseObject* creator ) : BaseObject(creator)
    4241  ChatHistory::ChatHistory()
    4342#else
  • code/trunk/src/orxonox/chat/ChatListener.h

    r8858 r9667  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "core/OrxonoxClass.h"
     34#include "core/object/Listable.h"
    3535
    3636namespace orxonox
     
    4040        message was sent through ChatManager.
    4141    */
    42     class _OrxonoxExport ChatListener : virtual public OrxonoxClass
     42    class _OrxonoxExport ChatListener : virtual public Listable
    4343    {
    4444        friend class ChatManager;
  • code/trunk/src/orxonox/chat/ChatManager.cc

    r8858 r9667  
    113113    // ChatListener                                                         //
    114114    //////////////////////////////////////////////////////////////////////////
     115    RegisterAbstractClass(ChatListener).inheritsFrom(Class(Listable));
    115116
    116117    ChatListener::ChatListener()
    117118    {
    118         RegisterRootObject(ChatListener);
     119        RegisterObject(ChatListener);
    119120    }
    120121}
  • code/trunk/src/orxonox/collisionshapes/CollisionShape.cc

    r8858 r9667  
    4444namespace orxonox
    4545{
     46    RegisterAbstractClass(CollisionShape).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable));
    4647
    4748    /**
     
    4950        Constructor. Registers and initializes the object.
    5051    */
    51     CollisionShape::CollisionShape(BaseObject* creator)
    52         : BaseObject(creator)
    53         , Synchronisable(creator)
     52    CollisionShape::CollisionShape(Context* context)
     53        : BaseObject(context)
     54        , Synchronisable(context)
    5455    {
    5556        RegisterObject(CollisionShape);
  • code/trunk/src/orxonox/collisionshapes/CollisionShape.h

    r8706 r9667  
    5858    {
    5959        public:
    60             CollisionShape(BaseObject* creator);
     60            CollisionShape(Context* context);
    6161            virtual ~CollisionShape();
    6262
  • code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r8858 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(CompoundCollisionShape);
     44    RegisterClass(CompoundCollisionShape);
    4545
    4646    /**
     
    4848        Constructor. Registers and initializes the object.
    4949    */
    50     CompoundCollisionShape::CompoundCollisionShape(BaseObject* creator) : CollisionShape(creator)
     50    CompoundCollisionShape::CompoundCollisionShape(Context* context) : CollisionShape(context)
    5151    {
    5252        RegisterObject(CompoundCollisionShape);
  • code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.h

    r8706 r9667  
    5858    {
    5959        public:
    60             CompoundCollisionShape(BaseObject* creator);
     60            CompoundCollisionShape(Context* context);
    6161            virtual ~CompoundCollisionShape();
    6262
  • code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc

    r8706 r9667  
    3737namespace orxonox
    3838{
    39     WorldEntityCollisionShape::WorldEntityCollisionShape(WorldEntity* creator) : CompoundCollisionShape(creator)
     39    WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context)
    4040    {
    4141        RegisterObject(WorldEntityCollisionShape);
    4242
    43         this->worldEntityOwner_ = creator;
     43        this->worldEntityOwner_ = NULL;
    4444        // suppress synchronisation
    4545        this->setSyncMode(ObjectDirection::None);
  • code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h

    r5781 r9667  
    3838    {
    3939        public:
    40             WorldEntityCollisionShape(WorldEntity* creator);
     40            WorldEntityCollisionShape(Context* context);
    4141            virtual ~WorldEntityCollisionShape();
    4242
    43             inline WorldEntity* getWorldEntityOwner()
     43            inline void setWorldEntityOwner(WorldEntity* worldEntityOwner)
     44                { this->worldEntityOwner_ = worldEntityOwner; }
     45            inline WorldEntity* getWorldEntityOwner() const
    4446                { return this->worldEntityOwner_; }
    4547
  • code/trunk/src/orxonox/controllers/AIController.cc

    r9016 r9667  
    3939    const float AIController::ACTION_INTERVAL = 1.0f;
    4040
    41     CreateFactory(AIController);
    42 
    43     AIController::AIController(BaseObject* creator) : ArtificialController(creator)
     41    RegisterClass(AIController);
     42
     43    AIController::AIController(Context* context) : ArtificialController(context)
    4444    {
    4545        RegisterObject(AIController);
  • code/trunk/src/orxonox/controllers/AIController.h

    r9016 r9667  
    4141    {
    4242        public:
    43             AIController(BaseObject* creator);
     43            AIController(Context* context);
    4444            virtual ~AIController();
    4545
  • code/trunk/src/orxonox/controllers/ArtificialController.cc

    r9252 r9667  
    4545    SetConsoleCommand("ArtificialController", "setbotlevel",      &ArtificialController::setAllBotLevel);
    4646
    47     ArtificialController::ArtificialController(BaseObject* creator) : FormationController(creator)
     47    RegisterClass(ArtificialController);
     48
     49    ArtificialController::ArtificialController(Context* context) : FormationController(context)
    4850    {
    4951        RegisterObject(ArtificialController);
  • code/trunk/src/orxonox/controllers/ArtificialController.h

    r9252 r9667  
    3939    {
    4040        public:
    41             ArtificialController(BaseObject* creator);
     41            ArtificialController(Context* context);
    4242            virtual ~ArtificialController();
    4343
  • code/trunk/src/orxonox/controllers/Controller.cc

    r6417 r9667  
    3333namespace orxonox
    3434{
    35     CreateUnloadableFactory(Controller);
     35    RegisterUnloadableClass(Controller);
    3636
    37     Controller::Controller(BaseObject* creator) : BaseObject(creator)
     37    Controller::Controller(Context* context) : BaseObject(context)
    3838    {
    3939        RegisterObject(Controller);
  • code/trunk/src/orxonox/controllers/Controller.h

    r9666 r9667  
    4242
    4343        public:
    44             Controller(BaseObject* creator);
     44            Controller(Context* context);
    4545            virtual ~Controller();
    4646
  • code/trunk/src/orxonox/controllers/DroneController.cc

    r8891 r9667  
    4141        Constructor.
    4242    */
    43     CreateFactory(DroneController);
     43    RegisterClass(DroneController);
    4444
    4545    const float DroneController::ACTION_INTERVAL = 1.0f;
    4646
    47     DroneController::DroneController(BaseObject* creator) : ArtificialController(creator)
     47    DroneController::DroneController(Context* context) : ArtificialController(context)
    4848    {
    4949        RegisterObject(DroneController);
  • code/trunk/src/orxonox/controllers/DroneController.h

    r8891 r9667  
    3333
    3434#include "AIController.h"
    35 #include "core/WeakPtr.h"
     35#include "core/object/WeakPtr.h"
    3636#include "tools/interfaces/Tickable.h"
    3737
     
    5050    {
    5151        public:
    52             DroneController(BaseObject* creator);
     52            DroneController(Context* context);
    5353            virtual ~DroneController();
    5454
  • code/trunk/src/orxonox/controllers/FormationController.cc

    r9663 r9667  
    5656    SetConsoleCommand("FormationController", "formationsize",    &FormationController::formationsize);
    5757
    58 
    59 
     58    RegisterClass(FormationController);
    6059
    6160    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 9;
     
    6968    static const float ROTATEFACTOR_FREE = 0.8f;
    7069
    71     FormationController::FormationController(BaseObject* creator) : Controller(creator)
     70    FormationController::FormationController(Context* context) : Controller(context)
    7271    {
    7372        RegisterObject(FormationController);
  • code/trunk/src/orxonox/controllers/FormationController.h

    r9625 r9667  
    3333
    3434#include <vector>
    35 #include "core/Super.h"
     35#include "core/class/Super.h"
    3636
    3737#include "util/Math.h"
    38 #include "core/OrxonoxClass.h"
    3938#include "controllers/Controller.h"
    4039#include "worldentities/ControllableEntity.h"
     
    4746
    4847      public:
    49       FormationController(BaseObject* creator);
     48      FormationController(Context* context);
    5049
    5150      virtual ~FormationController();
  • code/trunk/src/orxonox/controllers/HumanController.cc

    r9625 r9667  
    6666    SetConsoleCommand("HumanController", "myposition",             &HumanController::myposition    ).addShortcut();
    6767
    68     CreateUnloadableFactory(HumanController);
     68    RegisterUnloadableClass(HumanController);
    6969
    7070    HumanController* HumanController::localController_s = 0;
    7171    /*static*/ const float HumanController::BOOSTING_TIME = 0.1f;
    7272
    73     HumanController::HumanController(BaseObject* creator) : FormationController(creator)
     73    HumanController::HumanController(Context* context) : FormationController(context)
    7474    {
    7575        RegisterObject(HumanController);
  • code/trunk/src/orxonox/controllers/HumanController.h

    r9256 r9667  
    4444    { // tolua_export
    4545        public:
    46             HumanController(BaseObject* creator);
     46            HumanController(Context* context);
    4747            virtual ~HumanController();
    4848
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r9348 r9667  
    5656    SetConsoleCommand("NewHumanController", "unfire",     &NewHumanController::unfire    ).keybindMode(KeybindMode::OnRelease).addShortcut();
    5757
    58     CreateUnloadableFactory(NewHumanController);
     58    RegisterUnloadableClass(NewHumanController);
    5959
    6060    NewHumanController* NewHumanController::localController_s = 0;
    6161
    62     NewHumanController::NewHumanController(BaseObject* creator)
    63         : HumanController(creator)
     62    NewHumanController::NewHumanController(Context* context)
     63        : HumanController(context)
    6464        , crossHairOverlay_(NULL)
    6565        , centerOverlay_(NULL)
     
    9898        if (GameMode::showsGraphics())
    9999        {
    100             crossHairOverlay_ = new OrxonoxOverlay(this);
     100            crossHairOverlay_ = new OrxonoxOverlay(this->getContext());
    101101            crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3");
    102102            crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_));
     
    104104            //crossHairOverlay_->setAspectCorrection(true); not working
    105105
    106             centerOverlay_ = new OrxonoxOverlay(this);
     106            centerOverlay_ = new OrxonoxOverlay(this->getContext());
    107107            centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay");
    108108            centerOverlay_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
     
    112112            if (showDamageOverlay_)
    113113            {
    114                 damageOverlayTop_ = new OrxonoxOverlay(this);
     114                damageOverlayTop_ = new OrxonoxOverlay(this->getContext());
    115115                damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop");
    116116                damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
     
    118118                damageOverlayTop_->hide();
    119119
    120                 damageOverlayRight_ = new OrxonoxOverlay(this);
     120                damageOverlayRight_ = new OrxonoxOverlay(this->getContext());
    121121                damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight");
    122122                damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
     
    124124                damageOverlayRight_->hide();
    125125
    126                 damageOverlayBottom_ = new OrxonoxOverlay(this);
     126                damageOverlayBottom_ = new OrxonoxOverlay(this->getContext());
    127127                damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom");
    128128                damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
     
    130130                damageOverlayBottom_->hide();
    131131
    132                 damageOverlayLeft_ = new OrxonoxOverlay(this);
     132                damageOverlayLeft_ = new OrxonoxOverlay(this->getContext());
    133133                damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft");
    134134                damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
     
    139139            if (showArrows_)
    140140            {
    141                 arrowsOverlay1_ = new OrxonoxOverlay(this);
     141                arrowsOverlay1_ = new OrxonoxOverlay(this->getContext());
    142142                arrowsOverlay1_->setBackgroundMaterial("Orxonox/DirectionArrows1");
    143143                arrowsOverlay1_->setSize(Vector2(0.02727f, 0.36f * arrowsSize_));
     
    146146                arrowsOverlay1_->hide();
    147147
    148                 arrowsOverlay2_ = new OrxonoxOverlay(this);
     148                arrowsOverlay2_ = new OrxonoxOverlay(this->getContext());
    149149                arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2");
    150150                arrowsOverlay2_->setSize(Vector2(0.02727f, 0.59f * arrowsSize_));
     
    153153                arrowsOverlay2_->hide();
    154154
    155                 arrowsOverlay3_ = new OrxonoxOverlay(this);
     155                arrowsOverlay3_ = new OrxonoxOverlay(this->getContext());
    156156                arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3");
    157157                arrowsOverlay3_->setSize(Vector2(0.02727f, 0.77f * arrowsSize_));
     
    160160                arrowsOverlay3_->hide();
    161161
    162                 arrowsOverlay4_ = new OrxonoxOverlay(this);
     162                arrowsOverlay4_ = new OrxonoxOverlay(this->getContext());
    163163                arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4");
    164164                arrowsOverlay4_->setSize(Vector2(0.02727f, arrowsSize_));
  • code/trunk/src/orxonox/controllers/NewHumanController.h

    r9016 r9667  
    4242    {
    4343        public:
    44             NewHumanController(BaseObject* creator);
     44            NewHumanController(Context* context);
    4545            virtual ~NewHumanController();
    4646
  • code/trunk/src/orxonox/controllers/ScriptController.cc

    r5781 r9667  
    3232namespace orxonox
    3333{
    34     CreateFactory(ScriptController);
     34    RegisterClass(ScriptController);
    3535
    36     ScriptController::ScriptController(BaseObject* creator) : ArtificialController(creator)
     36    ScriptController::ScriptController(Context* context) : ArtificialController(context)
    3737    {
    3838        RegisterObject(ScriptController);
  • code/trunk/src/orxonox/controllers/ScriptController.h

    r5781 r9667  
    3838    {
    3939        public:
    40             ScriptController(BaseObject* creator);
     40            ScriptController(Context* context);
    4141            virtual ~ScriptController() { }
    4242
  • code/trunk/src/orxonox/controllers/WaypointController.cc

    r9252 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(WaypointController);
     36    RegisterClass(WaypointController);
    3737
    38     WaypointController::WaypointController(BaseObject* creator) : ArtificialController(creator)
     38    WaypointController::WaypointController(Context* context) : ArtificialController(context)
    3939    {
    4040        RegisterObject(WaypointController);
  • code/trunk/src/orxonox/controllers/WaypointController.h

    r9252 r9667  
    4141    {
    4242        public:
    43             WaypointController(BaseObject* creator);
     43            WaypointController(Context* context);
    4444            virtual ~WaypointController();
    4545
  • code/trunk/src/orxonox/controllers/WaypointPatrolController.cc

    r9016 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(WaypointPatrolController);
     38    RegisterClass(WaypointPatrolController);
    3939
    40     WaypointPatrolController::WaypointPatrolController(BaseObject* creator) : WaypointController(creator)
     40    WaypointPatrolController::WaypointPatrolController(Context* context) : WaypointController(context)
    4141    {
    4242        RegisterObject(WaypointPatrolController);
  • code/trunk/src/orxonox/controllers/WaypointPatrolController.h

    r9016 r9667  
    4040    {
    4141        public:
    42             WaypointPatrolController(BaseObject* creator);
     42            WaypointPatrolController(Context* context);
    4343            virtual ~WaypointPatrolController() {}
    4444
  • code/trunk/src/orxonox/gamestates/GSClient.cc

    r8858 r9667  
    3030
    3131#include "util/Exception.h"
    32 #include "core/CommandLineParser.h"
     32#include "core/config/CommandLineParser.h"
    3333#include "core/Game.h"
    3434#include "core/GameMode.h"
  • code/trunk/src/orxonox/gamestates/GSLevel.h

    r7876 r9667  
    3434#include <string>
    3535#include <set>
    36 #include "core/OrxonoxClass.h"
    3736#include "core/GameState.h"
    3837
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r8858 r9667  
    3131#include <OgreSceneManager.h>
    3232
    33 #include "core/ConfigValueIncludes.h"
     33#include "core/config/ConfigValueIncludes.h"
    3434#include "core/CoreIncludes.h"
    3535#include "core/Game.h"
     
    6666        : GameState(info)
    6767    {
    68         RegisterRootObject(GSMainMenu);
     68        RegisterObject(GSMainMenu);
    6969
    7070        InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r8079 r9667  
    3434#include "util/OgreForwardRefs.h"
    3535#include "core/GameState.h"
    36 #include "core/OrxonoxClass.h"
     36#include "core/config/Configurable.h"
    3737
    3838namespace orxonox
    3939{
    40     class _OrxonoxExport GSMainMenu : public GameState, public OrxonoxClass
     40    class _OrxonoxExport GSMainMenu : public GameState, public Configurable
    4141    {
    4242    public:
  • code/trunk/src/orxonox/gamestates/GSServer.cc

    r8858 r9667  
    3030
    3131#include "util/Output.h"
    32 #include "core/CommandLineParser.h"
     32#include "core/config/CommandLineParser.h"
    3333#include "core/Game.h"
    3434#include "core/GameMode.h"
  • code/trunk/src/orxonox/gametypes/Asteroids.cc

    r8858 r9667  
    3535namespace orxonox
    3636{
    37     CreateUnloadableFactory(Asteroids);
     37    RegisterUnloadableClass(Asteroids);
    3838
    39     Asteroids::Asteroids(BaseObject* creator) : Gametype(creator)
     39    Asteroids::Asteroids(Context* context) : Gametype(context)
    4040    {
    4141        RegisterObject(Asteroids);
  • code/trunk/src/orxonox/gametypes/Asteroids.h

    r5781 r9667  
    3838    {
    3939        public:
    40             Asteroids(BaseObject* creator);
     40            Asteroids(Context* context);
    4141            virtual ~Asteroids() {}
    4242
  • code/trunk/src/orxonox/gametypes/Deathmatch.cc

    r9348 r9667  
    3636namespace orxonox
    3737{
    38     CreateUnloadableFactory(Deathmatch);
     38    RegisterUnloadableClass(Deathmatch);
    3939
    40     Deathmatch::Deathmatch(BaseObject* creator) : Gametype(creator)
     40    Deathmatch::Deathmatch(Context* context) : Gametype(context)
    4141    {
    4242        RegisterObject(Deathmatch);
  • code/trunk/src/orxonox/gametypes/Deathmatch.h

    r9348 r9667  
    3838    {
    3939        public:
    40             Deathmatch(BaseObject* creator);
     40            Deathmatch(Context* context);
    4141            virtual ~Deathmatch() {}
    4242
  • code/trunk/src/orxonox/gametypes/Dynamicmatch.cc

    r9348 r9667  
    5454#include "worldentities/pawns/Pawn.h"
    5555#include "worldentities/pawns/SpaceShip.h"
    56 #include "core/ConfigValueIncludes.h"
     56#include "core/config/ConfigValueIncludes.h"
    5757#include "interfaces/TeamColourable.h"
    5858#include "items/Engine.h"
     
    6262namespace orxonox
    6363{
    64     CreateUnloadableFactory(Dynamicmatch);
    65 
    66     Dynamicmatch::Dynamicmatch(BaseObject* creator) : Gametype(creator)
     64    RegisterUnloadableClass(Dynamicmatch);
     65
     66    Dynamicmatch::Dynamicmatch(Context* context) : Gametype(context)
    6767    {
    6868        RegisterObject(Dynamicmatch);
  • code/trunk/src/orxonox/gametypes/Dynamicmatch.h

    r9348 r9667  
    4444    {
    4545        public:
    46             Dynamicmatch(BaseObject* creator);
     46            Dynamicmatch(Context* context);
    4747            virtual ~Dynamicmatch() {}
    4848
  • code/trunk/src/orxonox/gametypes/Gametype.cc

    r9348 r9667  
    3232#include "core/Core.h"
    3333#include "core/CoreIncludes.h"
    34 #include "core/ConfigValueIncludes.h"
     34#include "core/config/ConfigValueIncludes.h"
    3535#include "core/GameMode.h"
    3636#include "core/command/ConsoleCommand.h"
     
    4747namespace orxonox
    4848{
    49     CreateUnloadableFactory(Gametype);
    50 
    51     Gametype::Gametype(BaseObject* creator) : BaseObject(creator)
     49    RegisterUnloadableClass(Gametype);
     50
     51    Gametype::Gametype(Context* context) : BaseObject(context)
    5252    {
    5353        RegisterObject(Gametype);
    5454
    55         this->gtinfo_ = new GametypeInfo(creator);
     55        this->gtinfo_ = new GametypeInfo(context);
    5656
    5757        this->setGametype(SmartPtr<Gametype>(this, false));
     
    7474        if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty())
    7575        {
    76             this->scoreboard_ = new OverlayGroup(this);
     76            this->scoreboard_ = new OverlayGroup(context);
    7777            this->scoreboard_->addTemplate(this->scoreboardTemplate_);
    7878            this->scoreboard_->setGametype(this);
     
    160160                ControllableEntity* oldentity = it->first->getControllableEntity();
    161161
    162                 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity);
     162                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity->getContext());
    163163                if (oldentity->getCamera())
    164164                {
     
    283283                    this->gtinfo_->pawnKilled(victim->getPlayer());
    284284
    285                 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
     285                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getContext());
    286286                if (victim->getCamera())
    287287                {
     
    458458        {
    459459            // force spawn at spawnpoint with default pawn
    460             ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn);
     460            ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn->getContext());
    461461            spawn->spawn(entity);
    462462            player->startControl(entity);
     
    472472    {
    473473        for (unsigned int i = 0; i < amount; ++i)
    474             this->botclass_.fabricate(this);
     474            this->botclass_.fabricate(this->getContext());
    475475    }
    476476
  • code/trunk/src/orxonox/gametypes/Gametype.h

    r9348 r9667  
    3737
    3838#include "core/BaseObject.h"
    39 #include "core/SubclassIdentifier.h"
     39#include "core/class/SubclassIdentifier.h"
    4040#include "tools/interfaces/Tickable.h"
    4141#include "infos/GametypeInfo.h"
     
    6767
    6868        public:
    69             Gametype(BaseObject* creator);
     69            Gametype(Context* context);
    7070            virtual ~Gametype();
    7171
  • code/trunk/src/orxonox/gametypes/LastManStanding.cc

    r9348 r9667  
    3333#include "infos/PlayerInfo.h"
    3434#include "worldentities/pawns/Pawn.h"
    35 #include "core/ConfigValueIncludes.h"
     35#include "core/config/ConfigValueIncludes.h"
    3636#include "util/Convert.h"
    3737
    3838namespace orxonox
    3939{
    40     CreateUnloadableFactory(LastManStanding);
    41 
    42     LastManStanding::LastManStanding(BaseObject* creator) : Deathmatch(creator)
     40    RegisterUnloadableClass(LastManStanding);
     41
     42    LastManStanding::LastManStanding(Context* context) : Deathmatch(context)
    4343    {
    4444        RegisterObject(LastManStanding);
  • code/trunk/src/orxonox/gametypes/LastManStanding.h

    r7655 r9667  
    6565
    6666        public:
    67             LastManStanding(BaseObject* creator); //!< Default Constructor.
     67            LastManStanding(Context* context); //!< Default Constructor.
    6868            virtual ~LastManStanding() {} //!< Default Destructor.
    6969            void setConfigValues(); //!< Makes values configurable.
  • code/trunk/src/orxonox/gametypes/LastTeamStanding.cc

    r9348 r9667  
    3333#include "infos/PlayerInfo.h"
    3434#include "worldentities/pawns/Pawn.h"
    35 #include "core/ConfigValueIncludes.h"
     35#include "core/config/ConfigValueIncludes.h"
    3636#include "util/Convert.h"
    3737
    3838namespace orxonox
    3939{
    40     CreateUnloadableFactory(LastTeamStanding);
    41 
    42     LastTeamStanding::LastTeamStanding(BaseObject* creator) : TeamDeathmatch(creator)
     40    RegisterUnloadableClass(LastTeamStanding);
     41
     42    LastTeamStanding::LastTeamStanding(Context* context) : TeamDeathmatch(context)
    4343    {
    4444        RegisterObject(LastTeamStanding);
  • code/trunk/src/orxonox/gametypes/LastTeamStanding.h

    r8351 r9667  
    7171
    7272        public:
    73             LastTeamStanding(BaseObject* creator); //!< Default Constructor.
     73            LastTeamStanding(Context* context); //!< Default Constructor.
    7474            virtual ~LastTeamStanding(); //!< Default Destructor.
    7575
  • code/trunk/src/orxonox/gametypes/Mission.cc

    r9348 r9667  
    3737namespace orxonox
    3838{
    39     CreateUnloadableFactory(Mission);
     39    RegisterUnloadableClass(Mission);
    4040
    41     Mission::Mission(BaseObject* creator) : TeamGametype(creator)
     41    Mission::Mission(Context* context) : TeamGametype(context)
    4242    {
    4343        RegisterObject(Mission);
  • code/trunk/src/orxonox/gametypes/Mission.h

    r9348 r9667  
    3939    {
    4040        public:
    41             Mission(BaseObject* creator);
     41            Mission(Context* context);
    4242            virtual ~Mission() {}
    4343
  • code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc

    r9348 r9667  
    3636namespace orxonox
    3737{
    38     CreateUnloadableFactory(TeamBaseMatch);
    39 
    40     TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathmatch(creator)
     38    RegisterUnloadableClass(TeamBaseMatch);
     39
     40    TeamBaseMatch::TeamBaseMatch(Context* context) : TeamDeathmatch(context)
    4141    {
    4242        RegisterObject(TeamBaseMatch);
  • code/trunk/src/orxonox/gametypes/TeamBaseMatch.h

    r9348 r9667  
    4141    {
    4242        public:
    43             TeamBaseMatch(BaseObject* creator);
     43            TeamBaseMatch(Context* context);
    4444            virtual ~TeamBaseMatch() {}
    4545
  • code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc

    r9348 r9667  
    3636namespace orxonox
    3737{
    38     CreateUnloadableFactory(TeamDeathmatch);
     38    RegisterUnloadableClass(TeamDeathmatch);
    3939
    40     TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : TeamGametype(creator)
     40    TeamDeathmatch::TeamDeathmatch(Context* context) : TeamGametype(context)
    4141    {
    4242        RegisterObject(TeamDeathmatch);
  • code/trunk/src/orxonox/gametypes/TeamDeathmatch.h

    r9348 r9667  
    3838    {
    3939        public:
    40             TeamDeathmatch(BaseObject* creator);
     40            TeamDeathmatch(Context* context);
    4141            virtual ~TeamDeathmatch() {}
    4242
  • code/trunk/src/orxonox/gametypes/TeamGametype.cc

    r9348 r9667  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConfigValueIncludes.h"
     32#include "core/config/ConfigValueIncludes.h"
    3333#include "infos/PlayerInfo.h"
    3434#include "interfaces/TeamColourable.h"
     
    4040namespace orxonox
    4141{
    42     CreateUnloadableFactory(TeamGametype);
    43 
    44     TeamGametype::TeamGametype(BaseObject* creator) : Gametype(creator)
     42    RegisterUnloadableClass(TeamGametype);
     43
     44    TeamGametype::TeamGametype(Context* context) : Gametype(context)
    4545    {
    4646        RegisterObject(TeamGametype);
  • code/trunk/src/orxonox/gametypes/TeamGametype.h

    r9348 r9667  
    4141    {
    4242        public:
    43             TeamGametype(BaseObject* creator);
     43            TeamGametype(Context* context);
    4444            virtual ~TeamGametype() {}
    4545
  • code/trunk/src/orxonox/gametypes/UnderAttack.cc

    r9348 r9667  
    3131#include "util/Convert.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/ConfigValueIncludes.h"
     33#include "core/config/ConfigValueIncludes.h"
    3434#include "chat/ChatManager.h"
    3535#include "worldentities/pawns/Destroyer.h"
     
    3838namespace orxonox
    3939{
    40     CreateUnloadableFactory(UnderAttack);
     40    RegisterUnloadableClass(UnderAttack);
    4141
    42     UnderAttack::UnderAttack(BaseObject* creator) : TeamDeathmatch(creator)
     42    UnderAttack::UnderAttack(Context* context) : TeamDeathmatch(context)
    4343    {
    4444        RegisterObject(UnderAttack);
  • code/trunk/src/orxonox/gametypes/UnderAttack.h

    r5929 r9667  
    3939    {
    4040        public:
    41             UnderAttack(BaseObject* creator);
     41            UnderAttack(Context* context);
    4242            virtual ~UnderAttack() {}
    4343
  • code/trunk/src/orxonox/graphics/AnimatedModel.cc

    r8858 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(AnimatedModel);
     41    RegisterClass(AnimatedModel);
    4242
    43     AnimatedModel::AnimatedModel(BaseObject* creator) : Model(creator)
     43    AnimatedModel::AnimatedModel(Context* context) : Model(context)
    4444    {
    4545        RegisterObject(AnimatedModel);
  • code/trunk/src/orxonox/graphics/AnimatedModel.h

    r8858 r9667  
    4141    {
    4242        public:
    43             AnimatedModel(BaseObject* creator);
     43            AnimatedModel(Context* context);
    4444            virtual ~AnimatedModel();
    4545
  • code/trunk/src/orxonox/graphics/Backlight.cc

    r8424 r9667  
    4545namespace orxonox
    4646{
    47     CreateFactory(Backlight);
    48 
    49     Backlight::Backlight(BaseObject* creator) : FadingBillboard(creator)
     47    RegisterClass(Backlight);
     48
     49    Backlight::Backlight(Context* context) : FadingBillboard(context)
    5050    {
    5151        RegisterObject(Backlight);
  • code/trunk/src/orxonox/graphics/Backlight.h

    r7163 r9667  
    4141    {
    4242        public:
    43             Backlight(BaseObject* creator);
     43            Backlight(Context* context);
    4444            virtual ~Backlight();
    4545
  • code/trunk/src/orxonox/graphics/Billboard.cc

    r8706 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(Billboard);
     40    RegisterClass(Billboard);
    4141
    42     Billboard::Billboard(BaseObject* creator) : StaticEntity(creator)
     42    Billboard::Billboard(Context* context) : StaticEntity(context)
    4343    {
    4444        RegisterObject(Billboard);
  • code/trunk/src/orxonox/graphics/Billboard.h

    r8706 r9667  
    4444    {
    4545        public:
    46             Billboard(BaseObject* creator);
     46            Billboard(Context* context);
    4747            virtual ~Billboard();
    4848
  • code/trunk/src/orxonox/graphics/BlinkingBillboard.cc

    r8351 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(BlinkingBillboard);
     37    RegisterClass(BlinkingBillboard);
    3838
    39     BlinkingBillboard::BlinkingBillboard(BaseObject* creator) : Billboard(creator)
     39    BlinkingBillboard::BlinkingBillboard(Context* context) : Billboard(context)
    4040    {
    4141        RegisterObject(BlinkingBillboard);
  • code/trunk/src/orxonox/graphics/BlinkingBillboard.h

    r8351 r9667  
    4141    {
    4242        public:
    43             BlinkingBillboard(BaseObject* creator);
     43            BlinkingBillboard(Context* context);
    4444            virtual ~BlinkingBillboard();
    4545
  • code/trunk/src/orxonox/graphics/Camera.cc

    r8706 r9667  
    3737#include "util/StringUtils.h"
    3838#include "core/CoreIncludes.h"
    39 #include "core/ConfigValueIncludes.h"
     39#include "core/config/ConfigValueIncludes.h"
    4040#include "core/GameMode.h"
    4141#include "core/GUIManager.h"
     
    4646namespace orxonox
    4747{
    48     CreateFactory(Camera);
    49 
    50     Camera::Camera(BaseObject* creator) : StaticEntity(creator)
     48    RegisterClass(Camera);
     49
     50    Camera::Camera(Context* context) : StaticEntity(context)
    5151    {
    5252        RegisterObject(Camera);
  • code/trunk/src/orxonox/graphics/Camera.h

    r8706 r9667  
    4646
    4747        public:
    48             Camera(BaseObject* creator);
     48            Camera(Context* context);
    4949            virtual ~Camera();
    5050
  • code/trunk/src/orxonox/graphics/FadingBillboard.cc

    r5929 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(FadingBillboard);
     36    RegisterClass(FadingBillboard);
    3737
    38     FadingBillboard::FadingBillboard(BaseObject* creator) : Billboard(creator)
     38    FadingBillboard::FadingBillboard(Context* context) : Billboard(context)
    3939    {
    4040        RegisterObject(FadingBillboard);
  • code/trunk/src/orxonox/graphics/FadingBillboard.h

    r7163 r9667  
    4242    {
    4343        public:
    44             FadingBillboard(BaseObject* creator);
     44            FadingBillboard(Context* context);
    4545            virtual ~FadingBillboard();
    4646
  • code/trunk/src/orxonox/graphics/GlobalShader.cc

    r8079 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(GlobalShader);
     38    RegisterClass(GlobalShader);
    3939
    40     GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     40    GlobalShader::GlobalShader(Context* context) : BaseObject(context), Synchronisable(context)
    4141    {
    4242        RegisterObject(GlobalShader);
  • code/trunk/src/orxonox/graphics/GlobalShader.h

    r8079 r9667  
    4141    {
    4242        public:
    43             GlobalShader(BaseObject* creator);
     43            GlobalShader(Context* context);
    4444            virtual ~GlobalShader();
    4545
  • code/trunk/src/orxonox/graphics/Light.cc

    r5781 r9667  
    4242namespace orxonox
    4343{
    44     CreateFactory(Light);
     44    RegisterClass(Light);
    4545
    4646    // Be sure we don't do bad conversions
     
    4949    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight);
    5050
    51     Light::Light(BaseObject* creator) : StaticEntity(creator)
     51    Light::Light(Context* context) : StaticEntity(context)
    5252    {
    5353        RegisterObject(Light);
  • code/trunk/src/orxonox/graphics/Light.h

    r7401 r9667  
    5353
    5454        public:
    55             Light(BaseObject* creator);
     55            Light(Context* context);
    5656            virtual ~Light();
    5757
  • code/trunk/src/orxonox/graphics/MeshLodInformation.cc

    r7183 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(MeshLodInformation);
     40    RegisterClass(MeshLodInformation);
    4141
    42     MeshLodInformation::MeshLodInformation(BaseObject* creator)
    43     : BaseObject(creator), 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)
    4444    {
    4545        RegisterObject(MeshLodInformation);
  • code/trunk/src/orxonox/graphics/MeshLodInformation.h

    r7163 r9667  
    4141    {
    4242        public:
    43             MeshLodInformation(BaseObject* creator);
     43            MeshLodInformation(Context* context);
    4444            virtual ~MeshLodInformation();
    4545
  • code/trunk/src/orxonox/graphics/Model.cc

    r8858 r9667  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "core/ConfigValueIncludes.h"
     34#include "core/config/ConfigValueIncludes.h"
    3535#include "core/GameMode.h"
    3636#include "core/XMLPort.h"
     
    4141namespace orxonox
    4242{
    43     CreateFactory(Model);
    44 
    45     Model::Model(BaseObject* creator) :
    46         StaticEntity(creator), 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)
    4747    {
    4848        RegisterObject(Model);
  • code/trunk/src/orxonox/graphics/Model.h

    r7166 r9667  
    4141    {
    4242        public:
    43             Model(BaseObject* creator);
     43            Model(Context* context);
    4444            virtual ~Model();
    4545
  • code/trunk/src/orxonox/graphics/ParticleEmitter.cc

    r9550 r9667  
    4343namespace orxonox
    4444{
    45     CreateFactory(ParticleEmitter);
     45    RegisterClass(ParticleEmitter);
    4646
    47     ParticleEmitter::ParticleEmitter(BaseObject* creator) : StaticEntity(creator)
     47    ParticleEmitter::ParticleEmitter(Context* context) : StaticEntity(context)
    4848    {
    4949        RegisterObject(ParticleEmitter);
     
    6363        {
    6464            this->detachOgreObject(this->particles_->getParticleSystem());
    65             this->particles_->destroy();
     65            delete this->particles_;
    6666        }
    6767    }
     
    101101        if (this->particles_)
    102102        {
    103             this->particles_->destroy();
     103            delete this->particles_;
    104104            this->particles_ = 0;
    105105        }
  • code/trunk/src/orxonox/graphics/ParticleEmitter.h

    r7904 r9667  
    4040    {
    4141        public:
    42             ParticleEmitter(BaseObject* creator);
     42            ParticleEmitter(Context* context);
    4343            virtual ~ParticleEmitter();
    4444
  • code/trunk/src/orxonox/graphics/ParticleSpawner.cc

    r7284 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(ParticleSpawner);
     39    RegisterClass(ParticleSpawner);
    4040
    41     ParticleSpawner::ParticleSpawner(BaseObject* creator) : ParticleEmitter(creator)
     41    ParticleSpawner::ParticleSpawner(Context* context) : ParticleEmitter(context)
    4242    {
    4343        RegisterObject(ParticleSpawner);
  • code/trunk/src/orxonox/graphics/ParticleSpawner.h

    r5929 r9667  
    4040    {
    4141        public:
    42             ParticleSpawner(BaseObject* creator);
     42            ParticleSpawner(Context* context);
    4343            virtual ~ParticleSpawner();
    4444
  • code/trunk/src/orxonox/infos/Bot.cc

    r7801 r9667  
    3232#include "core/GameMode.h"
    3333#include "core/CoreIncludes.h"
    34 #include "core/ConfigValueIncludes.h"
     34#include "core/config/ConfigValueIncludes.h"
    3535#include "gametypes/Gametype.h"
    3636#include "controllers/AIController.h"
     
    3838namespace orxonox
    3939{
    40     CreateFactory(Bot);
     40    RegisterClass(Bot);
    4141
    42     Bot::Bot(BaseObject* creator) : PlayerInfo(creator)
     42    Bot::Bot(Context* context) : PlayerInfo(context)
    4343    {
    4444        RegisterObject(Bot);
  • code/trunk/src/orxonox/infos/Bot.h

    r5781 r9667  
    4040    {
    4141        public:
    42             Bot(BaseObject* creator);
     42            Bot(Context* context);
    4343            virtual ~Bot();
    4444
  • code/trunk/src/orxonox/infos/GametypeInfo.cc

    r9348 r9667  
    4848namespace orxonox
    4949{
    50     CreateUnloadableFactory(GametypeInfo);
     50    RegisterUnloadableClass(GametypeInfo);
    5151
    5252    registerMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage);
     
    6565        Registers and initializes the object.
    6666    */
    67     GametypeInfo::GametypeInfo(BaseObject* creator) : Info(creator)
     67    GametypeInfo::GametypeInfo(Context* context) : Info(context)
    6868    {
    6969        RegisterObject(GametypeInfo);
  • code/trunk/src/orxonox/infos/GametypeInfo.h

    r9348 r9667  
    5858
    5959        public:
    60             GametypeInfo(BaseObject* creator);
     60            GametypeInfo(Context* context);
    6161            virtual ~GametypeInfo();
    6262
  • code/trunk/src/orxonox/infos/HumanPlayer.cc

    r8327 r9667  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConfigValueIncludes.h"
     32#include "core/config/ConfigValueIncludes.h"
    3333#include "core/GameMode.h"
    3434// #include "network/ClientInformation.h"
     
    4141namespace orxonox
    4242{
    43     CreateUnloadableFactory(HumanPlayer);
    44 
    45     HumanPlayer::HumanPlayer(BaseObject* creator) : PlayerInfo(creator)
     43    RegisterUnloadableClass(HumanPlayer);
     44
     45    HumanPlayer::HumanPlayer(Context* context) : PlayerInfo(context)
    4646    {
    4747        RegisterObject(HumanPlayer);
     
    183183        if (this->isLocalPlayer() && !this->humanHudTemplate_.empty() && GameMode::showsGraphics())
    184184        {
    185             this->humanHud_ = new OverlayGroup(this);
     185            this->humanHud_ = new OverlayGroup(this->getContext());
    186186            this->humanHud_->addTemplate(this->humanHudTemplate_);
    187187            this->humanHud_->setOwner(this);
     
    199199        if (this->isLocalPlayer() && !this->gametypeHudTemplate_.empty())
    200200        {
    201             this->gametypeHud_ = new OverlayGroup(this);
     201            this->gametypeHud_ = new OverlayGroup(this->getContext());
    202202            this->gametypeHud_->addTemplate(this->gametypeHudTemplate_);
    203203            this->gametypeHud_->setOwner(this);
  • code/trunk/src/orxonox/infos/HumanPlayer.h

    r7163 r9667  
    4040    {
    4141        public:
    42             HumanPlayer(BaseObject* creator);
     42            HumanPlayer(Context* context);
    4343            virtual ~HumanPlayer();
    4444
  • code/trunk/src/orxonox/infos/Info.cc

    r5781 r9667  
    3232namespace orxonox
    3333{
    34     Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     34    RegisterClass(Info);
     35
     36    Info::Info(Context* context) : BaseObject(context), Synchronisable(context)
    3537    {
    3638        RegisterObject(Info);
  • code/trunk/src/orxonox/infos/Info.h

    r5781 r9667  
    4040    {
    4141        public:
    42             Info(BaseObject* creator);
     42            Info(Context* context);
    4343            virtual ~Info() {}
    4444    };
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r9348 r9667  
    4040namespace orxonox
    4141{
    42     PlayerInfo::PlayerInfo(BaseObject* creator) : Info(creator)
     42    RegisterAbstractClass(PlayerInfo).inheritsFrom(Class(Info));
     43
     44    PlayerInfo::PlayerInfo(Context* context) : Info(context)
    4345    {
    4446        RegisterObject(PlayerInfo);
     
    136138            this->controller_ = 0;
    137139        }
    138         this->controller_ = this->defaultController_.fabricate(this);
     140        this->controller_ = this->defaultController_.fabricate(this->getContext());
    139141        assert(this->controller_);
    140142        this->controller_->setPlayer(this);
  • code/trunk/src/orxonox/infos/PlayerInfo.h

    r8706 r9667  
    3333
    3434#include "Info.h"
    35 #include "core/SubclassIdentifier.h"
     35#include "core/class/SubclassIdentifier.h"
    3636
    3737namespace orxonox // tolua_export
     
    4141    { // tolua_export
    4242        public:
    43             PlayerInfo(BaseObject* creator);
     43            PlayerInfo(Context* context);
    4444            virtual ~PlayerInfo();
    4545
  • code/trunk/src/orxonox/interfaces/GametypeMessageListener.h

    r7163 r9667  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "core/OrxonoxClass.h"
     33#include "core/class/OrxonoxInterface.h"
    3434
    3535namespace orxonox
    3636{
    37     class _OrxonoxExport GametypeMessageListener : virtual public OrxonoxClass
     37    class _OrxonoxExport GametypeMessageListener : virtual public OrxonoxInterface
    3838    {
    3939        public:
  • code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc

    r8706 r9667  
    5050    // GametypeMessageListener
    5151    //----------------------------
     52    RegisterAbstractClass(GametypeMessageListener).inheritsFrom(Class(OrxonoxInterface));
     53
    5254    GametypeMessageListener::GametypeMessageListener()
    5355    {
    54         RegisterRootObject(GametypeMessageListener);
     56        RegisterObject(GametypeMessageListener);
    5557    }
    5658
     
    5860    // PlayerTrigger
    5961    //----------------------------
     62    RegisterAbstractClass(PlayerTrigger).inheritsFrom(Class(OrxonoxInterface));
     63
    6064    PlayerTrigger::PlayerTrigger()
    6165    {
    62         RegisterRootObject(PlayerTrigger);
     66        RegisterObject(PlayerTrigger);
    6367
    6468        this->isForPlayer_ = false;
     
    7680    // RadarListener
    7781    //----------------------------
     82    RegisterAbstractClass(RadarListener).inheritsFrom(Class(OrxonoxInterface));
     83
    7884    RadarListener::RadarListener()
    7985    {
    80         RegisterRootObject(RadarListener);
     86        RegisterObject(RadarListener);
    8187    }
    8288
     
    8490    // TeamColourable
    8591    //----------------------------
     92    RegisterAbstractClass(TeamColourable).inheritsFrom(Class(OrxonoxInterface));
     93
    8694    TeamColourable::TeamColourable()
    8795    {
    88         RegisterRootObject(TeamColourable);
     96        RegisterObject(TeamColourable);
    8997    }
    9098
     
    92100    // Rewardable
    93101    //----------------------------
     102    RegisterAbstractClass(Rewardable).inheritsFrom(Class(OrxonoxInterface));
     103
    94104    Rewardable::Rewardable()
    95105    {
    96         RegisterRootObject(Rewardable);
     106        RegisterObject(Rewardable);
    97107    }
    98108}
  • code/trunk/src/orxonox/interfaces/NotificationListener.cc

    r8706 r9667  
    5353    NotificationListener::NotificationListener()
    5454    {
    55         RegisterRootObject(NotificationListener);
     55        RegisterObject(NotificationListener);
    5656    }
    5757
  • code/trunk/src/orxonox/interfaces/NotificationListener.h

    r8706 r9667  
    4444#include "util/StringUtils.h"
    4545
    46 #include "core/OrxonoxClass.h"
     46#include "core/class/OrxonoxInterface.h"
    4747
    4848namespace orxonox
     
    9090    @todo Consistent terminology between message, notification and command.
    9191    */
    92     class _OrxonoxExport NotificationListener : virtual public OrxonoxClass
     92    class _OrxonoxExport NotificationListener : virtual public OrxonoxInterface
    9393    {
    9494        public:
  • code/trunk/src/orxonox/interfaces/PickupCarrier.cc

    r8858 r9667  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/Identifier.h"
     37#include "core/class/Identifier.h"
    3838
    3939#include "Pickupable.h"
    4040
    41 namespace orxonox {
     41namespace orxonox
     42{
     43    RegisterAbstractClass(PickupCarrier).inheritsFrom(Class(OrxonoxInterface));
    4244
    4345    /**
     
    4749    PickupCarrier::PickupCarrier()
    4850    {
    49         RegisterRootObject(PickupCarrier);
     51        RegisterObject(PickupCarrier);
    5052    }
    5153
  • code/trunk/src/orxonox/interfaces/PickupCarrier.h

    r7552 r9667  
    4141#include <vector>
    4242
    43 #include "core/OrxonoxClass.h"
     43#include "core/class/OrxonoxInterface.h"
    4444
    4545namespace orxonox
     
    6666    @ingroup Pickup
    6767    */
    68     class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass
     68    class _OrxonoxExport PickupCarrier : virtual public OrxonoxInterface
    6969    {
    7070        // So that the different Pickupables have full access to their PickupCarrier.
  • code/trunk/src/orxonox/interfaces/PickupListener.cc

    r8351 r9667  
    4747    PickupListener::PickupListener()
    4848    {
    49         RegisterRootObject(PickupListener);
     49        RegisterObject(PickupListener);
    5050    }
    5151
  • code/trunk/src/orxonox/interfaces/PickupListener.h

    r8351 r9667  
    3939#include "Pickupable.h"
    4040
    41 #include "core/OrxonoxClass.h"
     41#include "core/class/OrxonoxInterface.h"
    4242
    4343namespace orxonox
     
    5555    @ingroup Pickup
    5656    */
    57     class _OrxonoxExport PickupListener : virtual public OrxonoxClass
     57    class _OrxonoxExport PickupListener : virtual public OrxonoxInterface
    5858    {
    5959        public:
  • code/trunk/src/orxonox/interfaces/Pickupable.cc

    r9348 r9667  
    3434#include "Pickupable.h"
    3535
    36 #include "core/Identifier.h"
     36#include "core/class/Identifier.h"
    3737#include "core/CoreIncludes.h"
    3838#include "util/Convert.h"
     
    4646namespace orxonox
    4747{
     48    RegisterAbstractClass(Pickupable).inheritsFrom(Class(OrxonoxInterface)).inheritsFrom(Class(Rewardable));
    4849
    4950    /**
     
    5354    Pickupable::Pickupable() : used_(false), pickedUp_(false)
    5455    {
    55         RegisterRootObject(Pickupable);
     56        RegisterObject(Pickupable);
    5657
    5758        this->carrier_ = NULL;
     
    7172    /**
    7273    @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.
    7475    */
    7576    void Pickupable::preDestroy(void)
     
    9899    {
    99100        if(!this->isBeingDestroyed())
    100             this->OrxonoxClass::destroy();
     101            this->Destroyable::destroy();
    101102        else
    102103            orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl;
  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r9348 r9667  
    3939
    4040#include <list>
    41 #include "core/Super.h"
     41#include "core/class/Super.h"
    4242
    43 #include "core/OrxonoxClass.h"
     43#include "core/class/OrxonoxInterface.h"
    4444#include "Rewardable.h"
    4545
     
    5858    @ingroup Pickup
    5959    */
    60     class _OrxonoxExport Pickupable : virtual public OrxonoxClass, public Rewardable
     60    class _OrxonoxExport Pickupable : virtual public OrxonoxInterface, public Rewardable
    6161    {
    6262        friend class PickupCarrier;
     
    144144
    145145        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.
    147147            virtual void destroyPickup(void); //!< Destroys a Pickupable.
    148148            virtual void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
  • code/trunk/src/orxonox/interfaces/PlayerTrigger.h

    r8706 r9667  
    3838#include "OrxonoxPrereqs.h"
    3939
    40 #include "core/OrxonoxClass.h"
    41 #include "core/WeakPtr.h"
     40#include "core/class/OrxonoxInterface.h"
     41#include "core/object/WeakPtr.h"
    4242
    4343namespace orxonox
     
    5252    @ingroup Triggers
    5353    */
    54     class _OrxonoxExport PlayerTrigger : virtual public OrxonoxClass
     54    class _OrxonoxExport PlayerTrigger : virtual public OrxonoxInterface
    5555    {
    5656    public:
  • code/trunk/src/orxonox/interfaces/RadarListener.h

    r7163 r9667  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "core/OrxonoxClass.h"
     33#include "core/class/OrxonoxInterface.h"
    3434
    3535namespace orxonox
    3636{
    37     class _OrxonoxExport RadarListener : virtual public OrxonoxClass
     37    class _OrxonoxExport RadarListener : virtual public OrxonoxInterface
    3838    {
    3939    public:
  • code/trunk/src/orxonox/interfaces/RadarViewable.cc

    r9526 r9667  
    3838namespace orxonox
    3939{
     40    RegisterAbstractClass(RadarViewable).inheritsFrom(Class(OrxonoxInterface));
     41
    4042    /**
    4143        @brief Constructor.
     
    4547        , bVisibility_(true)
    4648        , bInitialized_(false)
    47         , creator_(creator)
    4849        , wePtr_(wePtr)
    4950        , radarObjectCamouflage_(0.0f)
     
    5253        , scale_(1.0f)
    5354    {
    54         RegisterRootObject(RadarViewable);
     55        RegisterObject(RadarViewable);
    5556
    5657        this->uniqueId_=getUniqueNumberString();
    5758        if( GameMode::showsGraphics() )
    5859        {
    59             this->radar_ = this->creator_->getScene()->getRadar();
     60            this->radar_ = creator->getScene()->getRadar();
    6061            this->radar_->addRadarObject(this);
    6162        }
  • code/trunk/src/orxonox/interfaces/RadarViewable.h

    r9526 r9667  
    3636
    3737#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"
    4040
    4141namespace orxonox
     
    4646    @brief Interface for receiving window events.
    4747    */
    48     class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
     48    class _OrxonoxExport RadarViewable : virtual public OrxonoxInterface
    4949    {
    5050    public:
     
    153153        //Map
    154154        std::string uniqueId_;
    155         BaseObject* creator_;
    156155
    157156
  • code/trunk/src/orxonox/interfaces/Rewardable.h

    r7163 r9667  
    3636
    3737#include "OrxonoxPrereqs.h"
    38 #include "core/OrxonoxClass.h"
     38#include "core/class/OrxonoxInterface.h"
    3939
    4040namespace orxonox
     
    4848        Damian 'Mozork' Frick
    4949    */
    50     class _OrxonoxExport Rewardable : virtual public OrxonoxClass
     50    class _OrxonoxExport Rewardable : virtual public OrxonoxInterface
    5151    {
    5252        public:
  • code/trunk/src/orxonox/interfaces/TeamColourable.h

    r5781 r9667  
    3333
    3434#include "util/UtilPrereqs.h"
    35 #include "core/OrxonoxClass.h"
     35#include "core/class/OrxonoxInterface.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport TeamColourable : virtual public OrxonoxClass
     39    class _OrxonoxExport TeamColourable : virtual public OrxonoxInterface
    4040    {
    4141        public:
  • code/trunk/src/orxonox/items/Engine.cc

    r8858 r9667  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConfigValueIncludes.h"
     32#include "core/config/ConfigValueIncludes.h"
    3333#include "core/Template.h"
    3434#include "core/XMLPort.h"
     
    4040namespace orxonox
    4141{
    42     CreateFactory(Engine);
     42    RegisterClass(Engine);
    4343
    4444    /**
     
    4646        Constructor. Registers and initializes the object.
    4747    */
    48     Engine::Engine(BaseObject* creator) : Item(creator)
     48    Engine::Engine(Context* context) : Item(context)
    4949    {
    5050        RegisterObject(Engine);
  • code/trunk/src/orxonox/items/Engine.h

    r8727 r9667  
    5656    {
    5757        public:
    58             Engine(BaseObject* creator);
     58            Engine(Context* context);
    5959            virtual ~Engine();
    6060
  • code/trunk/src/orxonox/items/Item.cc

    r5781 r9667  
    3232namespace orxonox
    3333{
    34     Item::Item(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     34    RegisterClass(Item);
     35
     36    Item::Item(Context* context) : BaseObject(context), Synchronisable(context)
    3537    {
    3638        RegisterObject(Item);
  • code/trunk/src/orxonox/items/Item.h

    r5781 r9667  
    4040    {
    4141        public:
    42             Item(BaseObject* creator);
     42            Item(Context* context);
    4343            virtual ~Item() {}
    4444    };
  • code/trunk/src/orxonox/items/MultiStateEngine.cc

    r8727 r9667  
    4949    static const float MAX_VELOCITY_BOOST = 221;
    5050
    51     CreateFactory(MultiStateEngine);
    52 
    53     MultiStateEngine::MultiStateEngine(BaseObject* creator) : Engine(creator)
     51    RegisterClass(MultiStateEngine);
     52
     53    MultiStateEngine::MultiStateEngine(Context* context) : Engine(context)
    5454    {
    5555        RegisterObject(MultiStateEngine);
     
    5757        if (GameMode::isMaster())
    5858        {
    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());
    6161            this->defEngineSndNormal_->setLooping(true);
    6262            this->defEngineSndBoost_->setLooping(true);
  • code/trunk/src/orxonox/items/MultiStateEngine.h

    r8727 r9667  
    4949            };
    5050
    51             MultiStateEngine(BaseObject* creator);
     51            MultiStateEngine(Context* context);
    5252            virtual ~MultiStateEngine();
    5353
  • code/trunk/src/orxonox/overlays/GUISheet.cc

    r7401 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(GUISheet);
     38    RegisterClass(GUISheet);
    3939
    40     GUISheet::GUISheet(BaseObject* creator)
    41         : BaseObject(creator)
     40    GUISheet::GUISheet(Context* context)
     41        : BaseObject(context)
    4242        , bShowOnLoad_(false)
    4343        , bHidePrevious_(false)
  • code/trunk/src/orxonox/overlays/GUISheet.h

    r7401 r9667  
    4141    {
    4242    public:
    43         GUISheet(BaseObject* creator);
     43        GUISheet(Context* context);
    4444        ~GUISheet();
    4545
  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r9550 r9667  
    4949#include "util/output/OutputManager.h"
    5050#include "core/CoreIncludes.h"
    51 #include "core/ConfigValueIncludes.h"
     51#include "core/config/ConfigValueIncludes.h"
    5252#include "core/command/ConsoleCommand.h"
    5353#include "core/GUIManager.h"
     
    110110
    111111        // destroy the underlaying shell
    112         this->shell_->destroy();
     112        delete this->shell_;
    113113
    114114        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r8858 r9667  
    6363    SetConsoleCommand("OrxonoxOverlay", "rotateOverlay",    &OrxonoxOverlay::rotateOverlay);
    6464
    65     OrxonoxOverlay::OrxonoxOverlay(BaseObject* creator)
    66         : BaseObject(creator)
     65    RegisterClass(OrxonoxOverlay);
     66
     67    OrxonoxOverlay::OrxonoxOverlay(Context* context)
     68        : BaseObject(context)
    6769    {
    6870        RegisterObject(OrxonoxOverlay);
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r8706 r9667  
    4242#include "util/OgreForwardRefs.h"
    4343#include "core/BaseObject.h"
    44 #include "core/Super.h"
    4544#include "core/WindowEventListener.h"
     45#include "core/class/Super.h"
    4646
    4747namespace orxonox
     
    8787
    8888    public:
    89         OrxonoxOverlay(BaseObject* creator);
     89        OrxonoxOverlay(Context* context);
    9090        virtual ~OrxonoxOverlay();
    9191
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r8309 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(OverlayGroup);
     43    RegisterClass(OverlayGroup);
    4444
    4545    SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
     
    4848    SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup);
    4949
    50     OverlayGroup::OverlayGroup(BaseObject* creator)
    51         : BaseObject(creator)
     50    OverlayGroup::OverlayGroup(Context* context)
     51        : BaseObject(context)
    5252    {
    5353        RegisterObject(OverlayGroup);
     
    148148        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
    149149            (*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());
    150159    }
    151160
  • code/trunk/src/orxonox/overlays/OverlayGroup.h

    r8309 r9667  
    5454    {
    5555    public:
    56         OverlayGroup(BaseObject* creator);
     56        OverlayGroup(Context* context);
    5757        //! Empty destructor.
    5858        ~OverlayGroup();
     
    6868            { return this->hudElements_; }
    6969
    70         void changedVisibility();
     70        virtual void changedVisibility();
     71        virtual void changedGametype();
    7172
    7273        void setOwner(BaseObject* owner);
  • code/trunk/src/orxonox/sound/BaseSound.cc

    r8858 r9667  
    4343namespace orxonox
    4444{
     45    RegisterAbstractClass(BaseSound).inheritsFrom(Class(Listable));
     46
    4547    BaseSound::BaseSound()
    4648        : bPooling_(false)
     
    5052        , pitch_ (1.0)
    5153    {
    52         RegisterRootObject(BaseSound);
     54        RegisterObject(BaseSound);
    5355
    5456        // Initialise audioSource_ to a value that is not a source
  • code/trunk/src/orxonox/sound/BaseSound.h

    r7856 r9667  
    3535#include <boost/shared_ptr.hpp>
    3636#include <OgreDataStream.h>
    37 #include "core/OrxonoxClass.h"
     37#include "core/object/Listable.h"
    3838
    3939namespace orxonox
     
    4343     * It serves as main interface to the OpenAL library.
    4444     */
    45     class _OrxonoxExport BaseSound : virtual public OrxonoxClass
     45    class _OrxonoxExport BaseSound : virtual public Listable
    4646    {
    4747    public:
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r8903 r9667  
    3939#include "util/Clock.h"
    4040#include "util/ScopedSingletonManager.h"
    41 #include "core/ConfigValueIncludes.h"
     41#include "core/config/ConfigValueIncludes.h"
    4242#include "core/CoreIncludes.h"
    4343#include "core/GameMode.h"
     
    6969        : effectsPoolSize_(0)
    7070    {
    71         RegisterRootObject(SoundManager);
     71        RegisterObject(SoundManager);
    7272
    7373        orxout(user_status) << "Loading sound" << endl;
  • code/trunk/src/orxonox/sound/SoundManager.h

    r8351 r9667  
    3939
    4040#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"
    4343
    4444// tolua_begin
     
    5959    class _OrxonoxExport SoundManager
    6060    // tolua_end
    61         : public Singleton<SoundManager>, public OrxonoxClass
     61        : public Singleton<SoundManager>, public Configurable
    6262    { // tolua_export
    6363        friend class Singleton<SoundManager>;
  • code/trunk/src/orxonox/sound/WorldAmbientSound.cc

    r7854 r9667  
    3636namespace orxonox
    3737{
    38     CreateFactory(WorldAmbientSound);
     38    RegisterClass(WorldAmbientSound);
    3939
    40     WorldAmbientSound::WorldAmbientSound(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     40    WorldAmbientSound::WorldAmbientSound(Context* context) : BaseObject(context), Synchronisable(context)
    4141    {
    4242        RegisterObject(WorldAmbientSound);
  • code/trunk/src/orxonox/sound/WorldAmbientSound.h

    r7854 r9667  
    4444    {
    4545        public:
    46             WorldAmbientSound(BaseObject* creator);
     46            WorldAmbientSound(Context* context);
    4747            virtual ~WorldAmbientSound();
    4848
  • code/trunk/src/orxonox/sound/WorldSound.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(WorldSound);
     43    RegisterClass(WorldSound);
    4444
    45     WorldSound::WorldSound(BaseObject* creator)
    46         : StaticEntity(creator)
     45    WorldSound::WorldSound(Context* context)
     46        : StaticEntity(context)
    4747    {
    4848        RegisterObject(WorldSound);
  • code/trunk/src/orxonox/sound/WorldSound.h

    r7854 r9667  
    4545    {
    4646    public:
    47         WorldSound(BaseObject* creator);
     47        WorldSound(Context* context);
    4848
    4949        void XMLPort(Element& xmlelement, XMLPort::Mode mode);
  • code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.cc

    r5781 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(DefaultWeaponmodeLink);
     37    RegisterClass(DefaultWeaponmodeLink);
    3838
    39     DefaultWeaponmodeLink::DefaultWeaponmodeLink(BaseObject* creator) : BaseObject(creator)
     39    DefaultWeaponmodeLink::DefaultWeaponmodeLink(Context* context) : BaseObject(context)
    4040    {
    4141        RegisterObject(DefaultWeaponmodeLink);
  • code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h

    r5781 r9667  
    3939    {
    4040        public:
    41             DefaultWeaponmodeLink(BaseObject* creator);
     41            DefaultWeaponmodeLink(Context* context);
    4242            virtual ~DefaultWeaponmodeLink();
    4343
  • code/trunk/src/orxonox/weaponsystem/Munition.cc

    r8729 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(Munition);
    38 
    39     Munition::Munition(BaseObject* creator) : BaseObject(creator)
     37    RegisterClass(Munition);
     38
     39    Munition::Munition(Context* context) : BaseObject(context)
    4040    {
    4141        RegisterObject(Munition);
  • code/trunk/src/orxonox/weaponsystem/Munition.h

    r7851 r9667  
    5656
    5757        public:
    58             Munition(BaseObject* creator);
     58            Munition(Context* context);
    5959            virtual ~Munition();
    6060
  • code/trunk/src/orxonox/weaponsystem/Weapon.cc

    r5929 r9667  
    3939namespace orxonox
    4040{
    41     CreateFactory(Weapon);
     41    RegisterClass(Weapon);
    4242
    43     Weapon::Weapon(BaseObject* creator) : StaticEntity(creator)
     43    Weapon::Weapon(Context* context) : StaticEntity(context)
    4444    {
    4545        RegisterObject(Weapon);
  • code/trunk/src/orxonox/weaponsystem/Weapon.h

    r5929 r9667  
    4242    {
    4343        public:
    44             Weapon(BaseObject* creator);
     44            Weapon(Context* context);
    4545            virtual ~Weapon();
    4646
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.cc

    r8858 r9667  
    4545namespace orxonox
    4646{
    47     WeaponMode::WeaponMode(BaseObject* creator) : BaseObject(creator)
     47    RegisterAbstractClass(WeaponMode).inheritsFrom(Class(BaseObject));
     48
     49    WeaponMode::WeaponMode(Context* context) : BaseObject(context)
    4850    {
    4951        RegisterObject(WeaponMode);
     
    7577        if( GameMode::isMaster() )
    7678        {
    77             this->defSndWpnFire_ = new WorldSound(this);
     79            this->defSndWpnFire_ = new WorldSound(this->getContext());
    7880            this->defSndWpnFire_->setLooping(false);
    7981            this->bSoundAttached_ = false;
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.h

    r8706 r9667  
    3636#include "util/Math.h"
    3737#include "core/BaseObject.h"
    38 #include "core/SubclassIdentifier.h"
     38#include "core/class/SubclassIdentifier.h"
    3939#include "tools/Timer.h"
    4040
     
    4444    {
    4545        public:
    46             WeaponMode(BaseObject* creator);
     46            WeaponMode(Context* context);
    4747            virtual ~WeaponMode();
    4848
  • code/trunk/src/orxonox/weaponsystem/WeaponPack.cc

    r6417 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(WeaponPack);
     40    RegisterClass(WeaponPack);
    4141
    42     WeaponPack::WeaponPack(BaseObject* creator) : BaseObject(creator)
     42    WeaponPack::WeaponPack(Context* context) : BaseObject(context)
    4343    {
    4444        RegisterObject(WeaponPack);
  • code/trunk/src/orxonox/weaponsystem/WeaponPack.h

    r6417 r9667  
    4141    {
    4242        public:
    43             WeaponPack(BaseObject* creator);
     43            WeaponPack(Context* context);
    4444            virtual ~WeaponPack();
    4545
  • code/trunk/src/orxonox/weaponsystem/WeaponSet.cc

    r5781 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(WeaponSet);
     39    RegisterClass(WeaponSet);
    4040
    41     WeaponSet::WeaponSet(BaseObject* creator) : BaseObject(creator)
     41    WeaponSet::WeaponSet(Context* context) : BaseObject(context)
    4242    {
    4343        RegisterObject(WeaponSet);
  • code/trunk/src/orxonox/weaponsystem/WeaponSet.h

    r5781 r9667  
    4141    {
    4242        public:
    43             WeaponSet(BaseObject* creator);
     43            WeaponSet(Context* context);
    4444            virtual ~WeaponSet();
    4545
  • code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc

    r8706 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(WeaponSlot);
     39    RegisterClass(WeaponSlot);
    4040
    41     WeaponSlot::WeaponSlot(BaseObject* creator) : StaticEntity(creator)
     41    WeaponSlot::WeaponSlot(Context* context) : StaticEntity(context)
    4242    {
    4343        RegisterObject(WeaponSlot);
  • code/trunk/src/orxonox/weaponsystem/WeaponSlot.h

    r8891 r9667  
    5757    {
    5858        public:
    59             WeaponSlot(BaseObject* creator);
     59            WeaponSlot(Context* context);
    6060            virtual ~WeaponSlot();
    6161
  • code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc

    r8729 r9667  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/SubclassIdentifier.h"
     32#include "core/class/SubclassIdentifier.h"
    3333#include "worldentities/pawns/Pawn.h"
    3434
     
    4646namespace orxonox
    4747{
    48     CreateFactory(WeaponSystem);
    49 
    50     WeaponSystem::WeaponSystem(BaseObject* creator) : BaseObject(creator)
     48    RegisterClass(WeaponSystem);
     49
     50    WeaponSystem::WeaponSystem(Context* context) : BaseObject(context)
    5151    {
    5252        RegisterObject(WeaponSystem);
     
    308308        else if (identifier->getIdentifier()->isA(Class(Munition)))
    309309        {
    310             Munition* munition = identifier->fabricate(this);
     310            Munition* munition = identifier->fabricate(this->getContext());
    311311            this->munitions_[identifier->getIdentifier()] = munition;
    312312            return munition;
  • code/trunk/src/orxonox/weaponsystem/WeaponSystem.h

    r6417 r9667  
    4343    {
    4444        public:
    45             WeaponSystem(BaseObject* creator);
     45            WeaponSystem(Context* context);
    4646            virtual ~WeaponSystem();
    4747
  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r8858 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(BigExplosion);
    44 
    45     BigExplosion::BigExplosion(BaseObject* creator) : StaticEntity(creator)
     43    RegisterClass(BigExplosion);
     44
     45    BigExplosion::BigExplosion(Context* context) : StaticEntity(context)
    4646    {
    4747        RegisterObject(BigExplosion);
     
    8080    void BigExplosion::init()
    8181    {
    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());
    8686
    8787        this->debrisEntity1_->setSyncMode(0);
     
    9090        this->debrisEntity4_->setSyncMode(0);
    9191
    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());
    9696
    9797        this->debris1_->setSyncMode(0);
     
    100100        this->debris4_->setSyncMode(0);
    101101
    102         this->explosion_ = new StaticEntity(this);
     102        this->explosion_ = new StaticEntity(this->getContext());
    103103        this->explosion_->setSyncMode(0);
    104104
     
    148148        this->debrisEntity4_->attach(debris4_);
    149149
    150         ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     150        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    151151        effect->setDestroyAfterLife(true);
    152152        effect->setSource("Orxonox/explosion2b");
     
    154154        effect->setSyncMode(0);
    155155
    156         ParticleSpawner* effect2 = new ParticleSpawner(this->getCreator());
     156        ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
    157157        effect2->setDestroyAfterLife(true);
    158158        effect2->setSource("Orxonox/smoke6");
     
    172172        for(int i=0;i<10;i++)
    173173        {
    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());
    179179
    180180            part1->setSyncMode(0);
     
    225225            {
    226226                this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
    227                 this->debrisFire1_->destroy();
     227                delete this->debrisFire1_;
    228228            }
    229229            if (this->debrisSmoke1_)
    230230            {
    231231                this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
    232                 this->debrisSmoke1_->destroy();
     232                delete this->debrisSmoke1_;
    233233            }
    234234
     
    236236            {
    237237                this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
    238                 this->debrisFire2_->destroy();
     238                delete this->debrisFire2_;
    239239            }
    240240            if (this->debrisSmoke2_)
    241241            {
    242242                this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
    243                 this->debrisSmoke2_->destroy();
     243                delete this->debrisSmoke2_;
    244244            }
    245245
     
    247247            {
    248248                this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
    249                 this->debrisFire3_->destroy();
     249                delete this->debrisFire3_;
    250250            }
    251251            if (this->debrisSmoke3_)
    252252            {
    253253                this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
    254                 this->debrisSmoke3_->destroy();
     254                delete this->debrisSmoke3_;
    255255            }
    256256
     
    258258            {
    259259                this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
    260                 this->debrisFire4_->destroy();
     260                delete this->debrisFire4_;
    261261            }
    262262            if (this->debrisSmoke4_)
    263263            {
    264264                this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
    265                 this->debrisSmoke4_->destroy();
     265                delete this->debrisSmoke4_;
    266266            }
    267267        }
  • code/trunk/src/orxonox/worldentities/BigExplosion.h

    r7176 r9667  
    4040    {
    4141        public:
    42             BigExplosion(BaseObject* creator);
     42            BigExplosion(Context* context);
    4343            virtual ~BigExplosion();
    4444
  • code/trunk/src/orxonox/worldentities/CameraPosition.cc

    r8706 r9667  
    3535namespace orxonox
    3636{
    37     CreateFactory(CameraPosition);
     37    RegisterClass(CameraPosition);
    3838
    39     CameraPosition::CameraPosition(BaseObject* creator) : StaticEntity(creator)
     39    CameraPosition::CameraPosition(Context* context) : StaticEntity(context)
    4040    {
    4141        RegisterObject(CameraPosition);
  • code/trunk/src/orxonox/worldentities/CameraPosition.h

    r5781 r9667  
    3838    {
    3939        public:
    40             CameraPosition(BaseObject* creator);
     40            CameraPosition(Context* context);
    4141            virtual ~CameraPosition();
    4242
  • code/trunk/src/orxonox/worldentities/ControllableEntity.cc

    r9348 r9667  
    3333
    3434#include "core/CoreIncludes.h"
    35 #include "core/ConfigValueIncludes.h"
     35#include "core/config/ConfigValueIncludes.h"
    3636#include "core/GameMode.h"
    3737#include "core/XMLPort.h"
     
    4747namespace orxonox
    4848{
    49     CreateFactory(ControllableEntity);
     49    RegisterClass(ControllableEntity);
    5050
    5151    registerMemberNetworkFunction( ControllableEntity, fire );
    5252    registerMemberNetworkFunction( ControllableEntity, setTargetInternal );
    5353
    54     ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator)
     54    ControllableEntity::ControllableEntity(Context* context) : MobileEntity(context)
    5555    {
    5656        RegisterObject(ControllableEntity);
     
    397397        if (!this->camera_ && GameMode::showsGraphics())
    398398        {
    399             this->camera_ = new Camera(this);
     399            this->camera_ = new Camera(this->getContext());
    400400            this->camera_->requestFocus();
    401401            if (!this->cameraPositionTemplate_.empty())
     
    423423            if (!this->hudtemplate_.empty())
    424424            {
    425                 this->hud_ = new OverlayGroup(this);
     425                this->hud_ = new OverlayGroup(this->getContext());
    426426                this->hud_->addTemplate(this->hudtemplate_);
    427427                this->hud_->setOwner(this);
  • code/trunk/src/orxonox/worldentities/ControllableEntity.h

    r9348 r9667  
    4444
    4545        public:
    46             ControllableEntity(BaseObject* creator);
     46            ControllableEntity(Context* context);
    4747            virtual ~ControllableEntity();
    4848
  • code/trunk/src/orxonox/worldentities/Drone.cc

    r7163 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(Drone);
     36    RegisterClass(Drone);
    3737    /**
    3838    @brief
    3939        Constructor. Registers the object and initializes some default values.
    4040    */
    41     Drone::Drone(BaseObject* creator) : Pawn(creator)
     41    Drone::Drone(Context* context) : Pawn(context)
    4242    {
    4343        RegisterObject(Drone);
     
    5050        this->setCollisionType(WorldEntity::Dynamic);
    5151
    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.
    5353        myController_->setDrone(this);
    5454
  • code/trunk/src/orxonox/worldentities/Drone.h

    r7163 r9667  
    4747    {
    4848        public:
    49             Drone(BaseObject* creator);
     49            Drone(Context* context);
    5050            virtual ~Drone();
    5151
  • code/trunk/src/orxonox/worldentities/EffectContainer.cc

    r6417 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(EffectContainer);
     42    RegisterClass(EffectContainer);
    4343
    44     EffectContainer::EffectContainer(BaseObject* creator)
    45         : BaseObject(creator)
     44    EffectContainer::EffectContainer(Context* context)
     45        : BaseObject(context)
    4646        , lua_(NULL)
    4747    {
  • code/trunk/src/orxonox/worldentities/EffectContainer.h

    r6417 r9667  
    4040    {
    4141        public:
    42             EffectContainer(BaseObject* creator);
     42            EffectContainer(Context* context);
    4343            virtual ~EffectContainer();
    4444
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.cc

    r8858 r9667  
    3838namespace orxonox
    3939{
    40     CreateFactory(ExplosionChunk);
     40    RegisterClass(ExplosionChunk);
    4141
    42     ExplosionChunk::ExplosionChunk(BaseObject* creator) : MovableEntity(creator)
     42    ExplosionChunk::ExplosionChunk(Context* context) : MovableEntity(context)
    4343    {
    4444        RegisterObject(ExplosionChunk);
     
    9292            {
    9393                this->detachOgreObject(this->fire_->getParticleSystem());
    94                 this->fire_->destroy();
     94                delete this->fire_;
    9595            }
    9696            if (this->smoke_)
    9797            {
    9898                this->detachOgreObject(this->smoke_->getParticleSystem());
    99                 this->smoke_->destroy();
     99                delete this->smoke_;
    100100            }
    101101        }
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.h

    r7163 r9667  
    4040    {
    4141        public:
    42             ExplosionChunk(BaseObject* creator);
     42            ExplosionChunk(Context* context);
    4343            virtual ~ExplosionChunk();
    4444
  • code/trunk/src/orxonox/worldentities/MobileEntity.cc

    r8858 r9667  
    3939namespace orxonox
    4040{
    41     MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator)
     41    RegisterClass(MobileEntity);
     42
     43    MobileEntity::MobileEntity(Context* context) : WorldEntity(context)
    4244    {
    4345        RegisterObject(MobileEntity);
  • code/trunk/src/orxonox/worldentities/MobileEntity.h

    r8727 r9667  
    4141    {
    4242        public:
    43             MobileEntity(BaseObject* creator);
     43            MobileEntity(Context* context);
    4444            virtual ~MobileEntity();
    4545
  • code/trunk/src/orxonox/worldentities/MovableEntity.cc

    r7284 r9667  
    4141    static const float CONTINUOUS_SYNCHRONIZATION_TIME = 10.0f;
    4242
    43     CreateFactory(MovableEntity);
     43    RegisterClass(MovableEntity);
    4444
    45     MovableEntity::MovableEntity(BaseObject* creator) : MobileEntity(creator)
     45    MovableEntity::MovableEntity(Context* context) : MobileEntity(context)
    4646    {
    4747        RegisterObject(MovableEntity);
  • code/trunk/src/orxonox/worldentities/MovableEntity.h

    r7163 r9667  
    4343    {
    4444        public:
    45             MovableEntity(BaseObject* creator);
     45            MovableEntity(Context* context);
    4646            virtual ~MovableEntity();
    4747
  • code/trunk/src/orxonox/worldentities/SpawnPoint.cc

    r8858 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(SpawnPoint);
     39    RegisterClass(SpawnPoint);
    4040
    41     SpawnPoint::SpawnPoint(BaseObject* creator) : StaticEntity(creator)
     41    SpawnPoint::SpawnPoint(Context* context) : StaticEntity(context)
    4242    {
    4343        RegisterObject(SpawnPoint);
     
    8181    Pawn* SpawnPoint::spawn()
    8282    {
    83         Pawn* entity = this->spawnclass_.fabricate(this);
     83        Pawn* entity = this->spawnclass_.fabricate(this->getContext());
    8484        if (entity)
    8585        {
  • code/trunk/src/orxonox/worldentities/SpawnPoint.h

    r5929 r9667  
    3333
    3434#include <string>
    35 #include "core/SubclassIdentifier.h"
     35#include "core/class/SubclassIdentifier.h"
    3636#include "worldentities/StaticEntity.h"
    3737
     
    4141    {
    4242        public:
    43             SpawnPoint(BaseObject* creator);
     43            SpawnPoint(Context* context);
    4444            virtual ~SpawnPoint() {}
    4545
  • code/trunk/src/orxonox/worldentities/StaticEntity.cc

    r8858 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(StaticEntity);
     39    RegisterClass(StaticEntity);
    4040
    41     StaticEntity::StaticEntity(BaseObject* creator) : WorldEntity(creator)
     41    StaticEntity::StaticEntity(Context* context) : WorldEntity(context)
    4242    {
    4343        RegisterObject(StaticEntity);
  • code/trunk/src/orxonox/worldentities/StaticEntity.h

    r7163 r9667  
    3939    {
    4040        public:
    41             StaticEntity(BaseObject* creator);
     41            StaticEntity(Context* context);
    4242            virtual ~StaticEntity();
    4343
  • code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc

    r5781 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(TeamSpawnPoint);
     36    RegisterClass(TeamSpawnPoint);
    3737
    38     TeamSpawnPoint::TeamSpawnPoint(BaseObject* creator) : SpawnPoint(creator)
     38    TeamSpawnPoint::TeamSpawnPoint(Context* context) : SpawnPoint(context)
    3939    {
    4040        RegisterObject(TeamSpawnPoint);
  • code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h

    r5781 r9667  
    4040    {
    4141        public:
    42             TeamSpawnPoint(BaseObject* creator);
     42            TeamSpawnPoint(Context* context);
    4343            virtual ~TeamSpawnPoint() {}
    4444
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r8858 r9667  
    6161    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World);
    6262
     63    RegisterAbstractClass(WorldEntity).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable));
     64
    6365    /**
    6466    @brief
     
    6668        All the default values are being set here.
    6769    */
    68     WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
     70    WorldEntity::WorldEntity(Context* context) : BaseObject(context), Synchronisable(context)
    6971    {
    7072        RegisterObject(WorldEntity);
     
    9294        this->bPhysicsActiveSynchronised_    = false;
    9395        this->bPhysicsActiveBeforeAttaching_ = false;
    94         this->collisionShape_ = new WorldEntityCollisionShape(this);
     96        this->collisionShape_ = new WorldEntityCollisionShape(this->getContext());
     97        this->collisionShape_->setWorldEntityOwner(this);
    9598        this->collisionType_             = None;
    9699        this->collisionTypeSynchronised_ = None;
  • code/trunk/src/orxonox/worldentities/WorldEntity.h

    r7910 r9667  
    9090
    9191        public:
    92             WorldEntity(BaseObject* creator);
     92            WorldEntity(Context* context);
    9393            virtual ~WorldEntity();
    9494
  • code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc

    r5929 r9667  
    3434namespace orxonox
    3535{
    36     CreateFactory(Destroyer);
     36    RegisterClass(Destroyer);
    3737
    38     Destroyer::Destroyer(BaseObject* creator) : SpaceShip(creator)
     38    Destroyer::Destroyer(Context* context) : SpaceShip(context)
    3939    {
    4040        RegisterObject(Destroyer);
  • code/trunk/src/orxonox/worldentities/pawns/Destroyer.h

    r5781 r9667  
    3939    {
    4040        public:
    41             Destroyer(BaseObject* creator);
     41            Destroyer(Context* context);
    4242            virtual ~Destroyer() {};
    4343
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r9016 r9667  
    3838
    3939#include "core/CoreIncludes.h"
    40 #include "core/ConfigValueIncludes.h"
     40#include "core/config/ConfigValueIncludes.h"
    4141#include "core/Template.h"
    4242#include "core/XMLPort.h"
     
    5353    const float orientationGain_ = 100;
    5454    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)
    5858    {
    5959        RegisterObject(FpsPlayer);
  • code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h

    r9016 r9667  
    4343    {
    4444        public:
    45             FpsPlayer(BaseObject* creator);
     45            FpsPlayer(Context* context);
    4646            virtual ~FpsPlayer();
    4747
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r9666 r9667  
    5151namespace orxonox
    5252{
    53     CreateFactory(Pawn);
    54 
    55     Pawn::Pawn(BaseObject* creator)
    56         : ControllableEntity(creator)
    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))
    5858    {
    5959        RegisterObject(Pawn);
     
    8686        if (GameMode::isMaster())
    8787        {
    88             this->weaponSystem_ = new WeaponSystem(this);
     88            this->weaponSystem_ = new WeaponSystem(this->getContext());
    8989            this->weaponSystem_->setPawn(this);
    9090        }
     
    299299        if (!this->spawnparticlesource_.empty())
    300300        {
    301             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     301            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    302302            effect->setPosition(this->getPosition());
    303303            effect->setOrientation(this->getOrientation());
     
    365365        this->setDestroyWhenPlayerLeft(false);
    366366
    367         BigExplosion* chunk = new BigExplosion(this->getCreator());
     367        BigExplosion* chunk = new BigExplosion(this->getContext());
    368368        chunk->setPosition(this->getPosition());
    369369
     
    373373        // play death effect
    374374        {
    375             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     375            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    376376            effect->setPosition(this->getPosition());
    377377            effect->setOrientation(this->getOrientation());
     
    381381        }
    382382        {
    383             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     383            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    384384            effect->setPosition(this->getPosition());
    385385            effect->setOrientation(this->getOrientation());
     
    389389        }
    390390        {
    391             ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
     391            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    392392            effect->setPosition(this->getPosition());
    393393            effect->setOrientation(this->getOrientation());
     
    398398        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
    399399        {
    400             ExplosionChunk* chunk = new ExplosionChunk(this->getCreator());
     400            ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
    401401            chunk->setPosition(this->getPosition());
    402402        }
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r9625 r9667  
    4545
    4646        public:
    47             Pawn(BaseObject* creator);
     47            Pawn(Context* context);
    4848            virtual ~Pawn();
    4949
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r9348 r9667  
    3232
    3333#include "core/CoreIncludes.h"
    34 #include "core/ConfigValueIncludes.h"
     34#include "core/config/ConfigValueIncludes.h"
    3535#include "core/Template.h"
    3636#include "core/XMLPort.h"
     
    4646namespace orxonox
    4747{
    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)
    5151    {
    5252        RegisterObject(SpaceShip);
     
    9696
    9797            if (this->boostBlur_)
    98                 this->boostBlur_->destroy();
     98                delete this->boostBlur_;
    9999        }
    100100    }
     
    447447        if (!this->bEnableMotionBlur_ && this->boostBlur_ != NULL)
    448448        {
    449             this->boostBlur_->destroy();
     449            delete this->boostBlur_;
    450450            this->boostBlur_ = NULL;
    451451        }
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h

    r8727 r9667  
    8888    {
    8989        public:
    90             SpaceShip(BaseObject* creator);
     90            SpaceShip(Context* context);
    9191            virtual ~SpaceShip();
    9292
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.cc

    r7863 r9667  
    3131#include "util/Convert.h"
    3232#include "core/CoreIncludes.h"
    33 #include "core/ConfigValueIncludes.h"
     33#include "core/config/ConfigValueIncludes.h"
    3434#include "core/GameMode.h"
    3535#include "core/command/CommandExecutor.h"
     
    4545    extern const std::string __CC_suicide_name;
    4646
    47     CreateFactory(Spectator);
    48 
    49     Spectator::Spectator(BaseObject* creator) : ControllableEntity(creator)
     47    RegisterClass(Spectator);
     48
     49    Spectator::Spectator(Context* context) : ControllableEntity(context)
    5050    {
    5151        RegisterObject(Spectator);
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.h

    r7862 r9667  
    4040    {
    4141        public:
    42             Spectator(BaseObject* creator);
     42            Spectator(Context* context);
    4343            virtual ~Spectator();
    4444
  • code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r5929 r9667  
    3737namespace orxonox
    3838{
    39     CreateFactory(TeamBaseMatchBase);
     39    RegisterClass(TeamBaseMatchBase);
    4040
    41     TeamBaseMatchBase::TeamBaseMatchBase(BaseObject* creator) : Pawn(creator)
     41    TeamBaseMatchBase::TeamBaseMatchBase(Context* context) : Pawn(context)
    4242    {
    4343        RegisterObject(TeamBaseMatchBase);
  • code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h

    r5781 r9667  
    5050    {
    5151        public:
    52             TeamBaseMatchBase(BaseObject* creator);
     52            TeamBaseMatchBase(Context* context);
    5353
    5454            // if class closes, close everything
  • code/trunk/test/CMakeLists.txt

    r9473 r9667  
    5353
    5454ADD_SUBDIRECTORY(util)
     55ADD_SUBDIRECTORY(core)
Note: See TracChangeset for help on using the changeset viewer.