Index: /orxonox/branches/levelLoader.tmp/src/Makefile.am
===================================================================
--- /orxonox/branches/levelLoader.tmp/src/Makefile.am	(revision 3901)
+++ /orxonox/branches/levelLoader.tmp/src/Makefile.am	(revision 3902)
@@ -12,4 +12,5 @@
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/math
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/xmlparser
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/defs
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/font
Index: /orxonox/branches/levelLoader.tmp/src/Makefile.in
===================================================================
--- /orxonox/branches/levelLoader.tmp/src/Makefile.in	(revision 3901)
+++ /orxonox/branches/levelLoader.tmp/src/Makefile.in	(revision 3902)
@@ -242,5 +242,5 @@
 target_vendor = @target_vendor@
 MAINSRCDIR = .
-AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/util/levelloader
+AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/xmlparser -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/util/levelloader
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
Index: /orxonox/branches/levelLoader.tmp/src/defs/stdincl.h
===================================================================
--- /orxonox/branches/levelLoader.tmp/src/defs/stdincl.h	(revision 3901)
+++ /orxonox/branches/levelLoader.tmp/src/defs/stdincl.h	(revision 3902)
@@ -27,5 +27,4 @@
 
 #include "compiler.h"
-#include "factory.h"
 
 #endif /* _STDINCL_H */
Index: /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.cc
===================================================================
--- /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.cc	(revision 3902)
+++ /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.cc	(revision 3902)
@@ -0,0 +1,97 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christian Meyer
+   co-programmer: ...
+*/
+
+
+#include "factory.h"
+#include "game_loader.h"
+
+using namespace std;
+
+/*  --------------------------------------------------
+*		 Factory
+*   --------------------------------------------------
+*/
+
+/**
+   \brief constructor
+   
+   set everything to zero and define classname
+*/
+Factory::Factory ()
+{
+	classname = "NULL";
+	next = NULL;
+}
+
+/**
+   \brief destructor
+   
+   clear the Q
+*/
+Factory::~Factory ()
+{
+	if( next != NULL)	delete next;
+}
+
+
+/**
+   \brief generates the associated object from data
+*/
+BaseObject* Factory::fabricate( TiXmlElement* data)
+{
+	return NULL;
+}
+
+/**
+   \brief make this particular factory known to the LevelFactory
+*/
+void Factory::initialize()
+{
+	assert( classname != NULL);
+	GameLoader* gl = GameLoader::getInstance();
+	gl->registerFactory( this);
+}
+
+/**
+   \brief add a Factory to the Q
+*/
+void Factory::registerFactory( Factory* factory)
+{
+	if( next == NULL) setNext( factory);
+	else next->registerFactory( factory);
+}
+
+const char* grabParameter( TiXmlElement* root, const char* name)
+{
+	TiXmlElement* element;
+	TiXmlNode* node;
+	
+	assert( root != NULL);
+	assert( name != NULL);
+	
+	element = root->FirstChildElement( name);
+	if( element == NULL) return NULL;
+	
+	node = element->FirstChild();
+	while( node != NULL)
+	{
+		if( node->ToText()) return node->Value();
+		node = node->NextSibling();
+	}
+	return NULL;
+}
+
Index: /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.h
===================================================================
--- /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.h	(revision 3902)
+++ /orxonox/branches/levelLoader.tmp/src/util/levelloader/factory.h	(revision 3902)
@@ -0,0 +1,59 @@
+/*! 
+    \file factory.h
+    \brief philosophy stuff
+*/
+
+#ifndef _FACTORY_H
+#define _FACTORY_H
+
+
+/** creates a Subclass of Factory, that HOPEFULLY loads modules \todo check it for real */
+#define CREATE_FACTORY(x) \
+		class x ## Factory : public Factory { \
+		 public:	\
+		  x ## Factory (){setNext( NULL); setClassname( #x ); initialize();} \
+		  ~x ## Factory () {}; \
+		 private: \
+			BaseObject* fabricate( TiXmlElement* root) \
+			{ \
+				if(!strcmp(root->Value(), getClassname())) return new  x ( root); \
+				else if( getNext() != NULL) return getNext()->fabricate( root); \
+				else return NULL; \
+			} \
+		}; \
+		x ## Factory global_ ## x ## Factory;
+
+#include "stdincl.h"
+
+class BaseObject;
+
+//! The Factory is
+/**
+	Very philosophic description, huh?
+*/
+class Factory {
+
+ public:
+  Factory ();
+  ~Factory ();
+
+	virtual BaseObject* fabricate( TiXmlElement* root);
+	void initialize();
+  void registerFactory( Factory* factory);
+	void setClassname(char* name) {classname = name;}
+	char* getClassname() {return classname;};
+	void setNext( Factory* factory) {next = factory;}
+	Factory* getNext() {return next;}
+	
+ private:
+	char* classname;
+	
+  Factory* next;
+};
+
+// helper function
+
+const char* grabParameter( TiXmlElement* root, const char* name);
+
+#endif /* _FACTORY_H */
+
