Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3530 in orxonox.OLD for orxonox/branches/levelloader/src/factory.h


Ignore:
Timestamp:
Mar 13, 2005, 10:40:25 PM (19 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Got the system to compile, the basic backbone now runs. What remains to be done is implementing all necessary functions to load all vital classes into a world

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/factory.h

    r3525 r3530  
    88
    99#include "stdincl.h"
    10 #include "world.h"
    1110
    12 #define CREATE_FACTORY(CLASS) class CLASSFactory : public Factory { \
    13  public:        \
    14   CLASSFactory (){setNext( NULL); setClassname = "CLASS"; initialize();} \
    15   ~CLASSFactory (); \
    16  private: \
    17         BaseObject* fabricate( TiXmlElement* root) \
    18         { \
    19                 if(!strcmp(root->Value(), getClassname())) return new CLASS( root); \
    20                 else if( next != NULL) return next->fabricate( root); \
    21                 else return NULL; \
    22         } \
    23 }; \
    24 CLASSFactory global_CLASSFactory;
     11class BaseObject;
    2512
    2613//! The Factory is
     
    3724        void initialize();
    3825  void registerFactory( Factory* factory);
    39         void setClassname(char* name) {classname = name};
    40         char* getClassname() {return classname};
    41         void setNext( ObjectFactory* factory) {next = factory};
     26        void setClassname(char* name) {classname = name;}
     27        char* getClassname() {return classname;};
     28        void setNext( Factory* factory) {next = factory;}
     29        Factory* getNext() {return next;}
    4230       
    4331 private:
Note: See TracChangeset for help on using the changeset viewer.