Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #pragma once
00011
00012 #include <mvsim/VisualObject.h>
00013 #include <mvsim/Simulable.h>
00014 #include <mvsim/ClassFactory.h>
00015
00016 namespace mvsim
00017 {
00018 class WorldElementBase : public VisualObject, public Simulable
00019 {
00020 public:
00021 WorldElementBase(World* parent) : VisualObject(parent) {}
00022 virtual ~WorldElementBase() {}
00028 static WorldElementBase* factory(
00029 World* parent, const rapidxml::xml_node<char>* xml_node,
00030 const char* class_name = NULL);
00031
00032 virtual void loadConfigFrom(const rapidxml::xml_node<char>* root) = 0;
00033
00034 protected:
00035 };
00036
00037
00038 typedef ClassFactory<WorldElementBase, World*, const rapidxml::xml_node<char>*>
00039 TClassFactory_worldElements;
00040 extern TClassFactory_worldElements classFactory_worldElements;
00041
00042 #define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME) \
00043 DECLARES_REGISTER_CLASS2( \
00044 CLASS_NAME, WorldElementBase, World*, const rapidxml::xml_node<char>*)
00045
00046 #define REGISTER_WORLD_ELEMENT(TEXTUAL_NAME, CLASS_NAME) \
00047 REGISTER_CLASS2( \
00048 TClassFactory_worldElements, classFactory_worldElements, TEXTUAL_NAME, \
00049 CLASS_NAME)
00050 }