Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 17, 2008, 3:40:02 PM (17 years ago)
Author:
landauf
Message:

added a Level-class and a first implementation of the Loader, using ClassTreeMask and TinyXML++

Location:
code/branches/core/src/orxonox
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/orxonox/Orxonox.cc

    r818 r820  
    8484#include "objects/test2.h"
    8585#include "objects/test3.h"
     86#include "core/Loader.h"
    8687
    8788#include "Orxonox.h"
     
    849850        std::cout << "2\n";
    850851*/
    851 
     852/*
    852853        std::cout << "Test 13\n";
    853854
     
    11101111
    11111112        std::cout << "13\n";
     1113*/
    11121114/*
    11131115        std::cout << "Test 14\n";
     
    11341136        std::cout << "2\n";
    11351137*/
     1138
     1139        std::cout << "Test 15\n";
     1140        std::cout << "1\n";
     1141
     1142        Level* test15_1 = new Level("levels/sample.oxw");
     1143        Loader::open(test15_1);
     1144
     1145        std::cout << "2\n";
     1146
    11361147//    startRenderLoop();
    11371148  }
  • code/branches/core/src/orxonox/core/BaseObject.cc

    r813 r820  
    4545    {
    4646        RegisterRootObject(BaseObject);
     47
     48        this->level_ = 0;
    4749    }
    4850
  • code/branches/core/src/orxonox/core/BaseObject.h

    r813 r820  
    5050            virtual ~BaseObject();
    5151            virtual void loadParams(TiXmlElement* xmlElem);
     52
     53            /** @brief Returns a pointer to the level that loaded this object. @return The level */
     54            inline const Level* getLevel() const { return this->level_; }
     55
     56        private:
     57            const Level* level_;                        //!< The level that loaded this object
    5258    };
    5359    ExportClass(BaseObject, Core);
  • code/branches/core/src/orxonox/core/CMakeLists.txt

    r813 r820  
    1414  Language.cc
    1515  ClassTreeMask.cc
    16 #  Level.cc
     16  Loader.cc
    1717)
    1818
  • code/branches/core/src/orxonox/core/ConfigValueContainer.cc

    r813 r820  
    876876        if (!file.is_open())
    877877        {
    878             COUT(1) << "An error occurred in ConfigValueContainer:" << std::endl;
     878            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
    879879            COUT(1) << "Error: Couldn't open config-file " << filename << " to read the config values!" << std::endl;
    880880            return;
     
    923923        if (!file.is_open())
    924924        {
    925             COUT(1) << "An error occurred in ConfigValueContainer:" << std::endl;
     925            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
    926926            COUT(1) << "Error: Couldn't open config-file " << filename << " to write the config values!" << std::endl;
    927927            return;
  • code/branches/core/src/orxonox/core/CoreIncludes.h

    r813 r820  
    7979*/
    8080#define RegisterObject(ClassName) \
    81     COUT(4) << "*** Register Object: " << #ClassName << std::endl; \
     81    COUT(5) << "*** Register Object: " << #ClassName << std::endl; \
    8282    InternRegisterObject(ClassName, false)
    8383
     
    8787*/
    8888#define RegisterRootObject(ClassName) \
    89     COUT(4) << "*** Register Root-Object: " << #ClassName << std::endl; \
     89    COUT(5) << "*** Register Root-Object: " << #ClassName << std::endl; \
    9090    InternRegisterRootObject(ClassName)
    9191
  • code/branches/core/src/orxonox/core/CorePrereqs.h

    r813 r820  
    8181  class Identifier;
    8282  class IdentifierDistributor;
    83 //  class IdentifierList;
    84 //  class IdentifierListElement;
    8583  template <class T>
    8684  class Iterator;
     
    8886  class LanguageEntry;
    8987  class Level;
     88  class Loader;
    9089  class MetaObjectList;
    9190  template <class T>
  • code/branches/core/src/orxonox/core/Identifier.cc

    r817 r820  
    125125        else
    126126        {
    127             COUT(1) << "An error occurred in Identifier:" << std::endl;
     127            COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
    128128            COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
    129129            COUT(1) << "Aborting..." << std::endl;
  • code/branches/core/src/orxonox/core/Identifier.h

    r817 r820  
    266266    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass)
    267267    {
    268         COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
     268        COUT(5) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
    269269
    270270        // Check if at least one object of the given type was created
     
    305305    void ClassIdentifier<T>::addObject(T* object)
    306306    {
    307         COUT(4) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
     307        COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
    308308        object->getMetaList().add(this->objects_, this->objects_->add(object));
    309309    }
     
    359359                if (!identifier->isA(ClassManager<T>::getIdentifier()))
    360360                {
    361                     COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
     361                    COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    362362                    COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
    363363                    COUT(1) << "Error: SubclassIdentifier<" << ClassManager<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
     
    406406                    if (this->identifier_)
    407407                    {
    408                         COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
     408                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    409409                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
    410410                        COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
     
    413413                    else
    414414                    {
    415                         COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
     415                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    416416                        COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
    417417                        COUT(1) << "Aborting..." << std::endl;
  • code/branches/core/src/orxonox/core/Language.cc

    r813 r820  
    230230        if (!file.is_open())
    231231        {
    232             COUT(1) << "An error occurred in Language:" << std::endl;
     232            COUT(1) << "An error occurred in Language.cc:" << std::endl;
    233233            COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
    234234            return;
     
    272272        if (!file.is_open())
    273273        {
    274             COUT(1) << "An error occurred in Language:" << std::endl;
     274            COUT(1) << "An error occurred in Language.cc:" << std::endl;
    275275            COUT(1) << "Error: Couldn't open file " << getFileName(this->language_) << " to read the translated language entries!" << std::endl;
    276276            ResetConfigValue(language_);
     
    324324        if (!file.is_open())
    325325        {
    326             COUT(1) << "An error occurred in Language:" << std::endl;
     326            COUT(1) << "An error occurred in Language.cc:" << std::endl;
    327327            COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
    328328            return;
  • code/branches/core/src/orxonox/core/MetaObjectList.h

    r813 r820  
    9999
    100100
    101         COUT(4) << "*** MetaObjectList: Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
     101        COUT(5) << "*** MetaObjectList: Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
    102102        delete this->element_;
    103103    }
Note: See TracChangeset for help on using the changeset viewer.