Index: /branches/ai/src/ai/Makefile
===================================================================
--- /branches/ai/src/ai/Makefile	(revision 10040)
+++ /branches/ai/src/ai/Makefile	(revision 10041)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # src/ai/Makefile.  Generated from Makefile.in by configure.
 
@@ -15,6 +15,4 @@
 
 
-
-SOURCES = $(libORXai_a_SOURCES)
 
 srcdir = .
@@ -75,19 +73,19 @@
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run aclocal-1.9
+ACLOCAL = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run aclocal-1.9
 AMDEP_FALSE = #
 AMDEP_TRUE = 
-AMTAR = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run tar
-AUTOCONF = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run automake-1.9
-AWK = gawk
+AMTAR = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run tar
+AUTOCONF = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run automake-1.9
+AWK = mawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
 CFLAGS = -g -O2
 CPP = gcc -E
-CPPFLAGS =  -g -Wall -I/usr/pack/gamelibs-1.0-to/include -I/usr/pack/sdl-1.2.11-mo/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+CPPFLAGS =  -g -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/lua50
 CURL_CFLAGS = 
-CURL_LIBS = 
+CURL_LIBS = -L/usr/lib -lcurl -L/usr/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -ldl -lssl -lcrypto -lz
 CXX = g++
 CXXDEPMODE = depmode=gcc3
@@ -99,26 +97,27 @@
 DOCUMENTATION_FALSE = 
 DOCUMENTATION_TRUE = #
-DOXYGEN = /usr/sepp/bin/doxygen
-DOXYGEN_FALSE = #
-DOXYGEN_TRUE = 
+DOXYGEN = 
+DOXYGEN_FALSE = 
+DOXYGEN_TRUE = #
 ECHO_C = 
 ECHO_N = -n
 ECHO_T = 
-EGREP = grep -E
+EGREP = /bin/grep -E
 EXEEXT = 
 GPROF = /usr/bin/gprof
-HAVE_CURL_FALSE = 
-HAVE_CURL_TRUE = #
+GREP = /bin/grep
+HAVE_CURL_FALSE = #
+HAVE_CURL_TRUE = 
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
 INSTALL_SCRIPT = ${INSTALL}
 INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-LDFLAGS =  -L/usr/pack/gamelibs-1.0-to/i686-debian-linux3.1/lib -Wl,-rpath -Wl,/usr/pack/gamelibs-1.0-to/i686-debian-linux3.1/lib -L/usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/lib -Wl,-rpath -Wl,/usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/lib
+LDFLAGS =  -L/usr/lib -Wl,-rpath -Wl,/usr/lib
 LIBOBJS = 
-LIBS = -ldl  -lGL -lGLU -lGLEW -lopenal -lSDL -lSDL_ttf -lSDL_image -lSDL_net -lavcodec -lavformat -lavcodec -lavutil -lvorbisenc -lvorbisfile -lvorbis -logg -lQtCore -lQtGui -lQtOpenGL -lz -lm
+LIBS = -ldl  -lGL -lGLU -lGLEW -lopenal -lSDL -lSDL_ttf -lSDL_image -lSDL_net -lavcodec -lavformat -lavcodec -lavutil -ltheora -ldts -lgsm -ldc1394_control -lvorbisenc -lvorbisfile -lvorbis -logg -lQtCore -lQtGui -lQtOpenGL -lcurl -lz -lm
 LTLIBOBJS = 
-LUA_INCLUDES = -I/extern_libs
-LUA_LIBS = -llualib -llua
-MAKEINFO = ${SHELL} /home/tfahrni/Projekte/Orxonox/mybranche/missing --run makeinfo
+LUA_INCLUDES = 
+LUA_LIBS =  -llua50 -llualib
+MAKEINFO = ${SHELL} /home/thomas/Projects/Orxonox/aibranch/missing --run makeinfo
 MSBITFIELDS = 
 OBJEXT = o
@@ -131,14 +130,14 @@
 PATH_SEPARATOR = :
 QT_CFLAGS = 
-QT_CXXFLAGS = -I/usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/include
+QT_CXXFLAGS = -I/usr/include/qt4
 QT_INCLUDE_DIR = 
 QT_LDFLAGS = 
 QT_LIBS =  -lQtCore
-QT_MOC = /usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/bin/moc
-QT_RCC = /usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/bin/rcc
-QT_UIC = /usr/pack/qt-4.1.1-mo/i686-debian-linux3.1/bin/uic
+QT_MOC = /usr/bin/moc-qt4
+QT_RCC = /usr/bin/rcc
+QT_UIC = /usr/bin/uic
 RANLIB = ranlib
 SET_MAKE = 
-SHELL = /bin/sh
+SHELL = /bin/bash
 STRIP = 
 SUB_PROJECTS_FALSE = 
@@ -147,6 +146,4 @@
 ac_ct_CC = gcc
 ac_ct_CXX = g++
-ac_ct_RANLIB = ranlib
-ac_ct_STRIP = 
 am__fastdepCC_FALSE = #
 am__fastdepCC_TRUE = 
@@ -164,5 +161,8 @@
 build_os = linux-gnu
 build_vendor = pc
-datadir = ${prefix}/share
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
 exec_prefix = ${prefix}
 host = i686-pc-linux-gnu
@@ -171,15 +171,19 @@
 host_os = linux-gnu
 host_vendor = pc
+htmldir = ${docdir}
 includedir = ${prefix}/include
-infodir = ${prefix}/info
-install_sh = /home/tfahrni/Projekte/Orxonox/mybranche/install-sh
+infodir = ${datarootdir}/info
+install_sh = /home/thomas/Projects/Orxonox/aibranch/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
 localstatedir = ${prefix}/var
-mandir = ${prefix}/man
+mandir = ${datarootdir}/man
 mkdir_p = mkdir -p --
 oldincludedir = /usr/include
+pdfdir = ${docdir}
 prefix = /usr/local
 program_transform_name = s,x,x,
+psdir = ${docdir}
 sbindir = ${exec_prefix}/sbin
 sharedstatedir = ${prefix}/com
Index: /branches/ai/src/ai/Makefile.in
===================================================================
--- /branches/ai/src/ai/Makefile.in	(revision 10040)
+++ /branches/ai/src/ai/Makefile.in	(revision 10041)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
@@ -15,6 +15,4 @@
 @SET_MAKE@
 
-
-SOURCES = $(libORXai_a_SOURCES)
 
 srcdir = @srcdir@
@@ -108,4 +106,5 @@
 EXEEXT = @EXEEXT@
 GPROF = @GPROF@
+GREP = @GREP@
 HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
 HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
@@ -147,6 +146,4 @@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@@ -165,4 +162,7 @@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
@@ -171,4 +171,5 @@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
@@ -176,10 +177,13 @@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
Index: /branches/ai/src/ai/ai_engine.cc
===================================================================
--- /branches/ai/src/ai/ai_engine.cc	(revision 10040)
+++ /branches/ai/src/ai/ai_engine.cc	(revision 10041)
@@ -30,6 +30,36 @@
 
 
+
+/*AITeam* AIEngine::newTeam()
+{
+	AITeam* newTeam=new AITeam;
+	teams.push_back(newTeam);
+	return newTeam;
+}*/
+int AIEngine::newTeam()
+{
+	AITeam* newTeam=new AITeam;
+	teams.push_back(newTeam);
+	return teams.size()-1;
+}
+
+
+
+AITeam* AIEngine::getTeam(int aiTeamNumber)
+{
+ 	//if(teams.size()>aiTeamNumber)
+	return teams.at(aiTeamNumber);
+	//return NULL;
+}
+
+
+
 void AIEngine::process()
 {
-  PRINTF(0)("Processing AI..\n");
+	int teamCount=teams.size();
+	for(int i=0; i < teamCount; i++ )
+	{
+   	//std::cout << "Processing Team " << i <<  "...\n";
+   	teams.at(i)->process();
+	}
 }
Index: /branches/ai/src/ai/ai_engine.h
===================================================================
--- /branches/ai/src/ai/ai_engine.h	(revision 10040)
+++ /branches/ai/src/ai/ai_engine.h	(revision 10041)
@@ -14,6 +14,8 @@
 
    void process();
-  private:
-    AIEngine();
+   AITeam* getTeam(int);
+	int newTeam();
+ private:
+	AIEngine();
 
  private:
Index: /branches/ai/src/ai/ai_team.cc
===================================================================
--- /branches/ai/src/ai/ai_team.cc	(revision 10040)
+++ /branches/ai/src/ai/ai_team.cc	(revision 10041)
@@ -15,5 +15,5 @@
    co-programmer:
 */
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI
 
 #include "ai_team.h"
@@ -26,3 +26,22 @@
 
 void AITeam::process()
-{}
+{
+	int teamSize=teamMembers.size();
+	for(int i=0; i < teamSize; i++ )
+	{
+   	//std::cout << "Processing TeamMember " << i <<  "...\n";
+   	teamMembers.at(i)->process();
+	}
+}
+
+
+void AITeam::addMember(AITeamMember* newMember)
+{
+	teamMembers.push_back(newMember);
+}
+
+
+AITeamMember* AITeam::getTeamMember(int teamMemberID)
+{
+	return teamMembers.at(teamMemberID);
+}
Index: /branches/ai/src/ai/ai_team.h
===================================================================
--- /branches/ai/src/ai/ai_team.h	(revision 10040)
+++ /branches/ai/src/ai/ai_team.h	(revision 10041)
@@ -11,4 +11,6 @@
    ~AITeam();
    void process();
+   void addMember(AITeamMember*);
+   AITeamMember* getTeamMember(int);
  private:
    std::vector<AITeamMember*> teamMembers;
Index: /branches/ai/src/ai/ai_team_member.cc
===================================================================
--- /branches/ai/src/ai/ai_team_member.cc	(revision 10040)
+++ /branches/ai/src/ai/ai_team_member.cc	(revision 10041)
@@ -1,4 +1,2 @@
-
-
 /*
    orxonox - the future of 3D-vertical-scrollers
@@ -12,10 +10,11 @@
 
    ### File Specific:
-   main-programmer: Patrick Boenzli
+   main-programmer: Thomas Fahrni
    co-programmer:
 */
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI
 #include "ai_team_member.h"
+#include "ai_engine.h"
 
 AITeamMember::AITeamMember()
@@ -25,8 +24,31 @@
 {}
 
+
+
 void AITeamMember::process()
-{}
+{
+	int moduleCount=modules.size();
+	for(int i=0; i < moduleCount; i++ )
+	{
+   	std::cout << "Processing AIModule " << i <<  "...\n";
+   	modules.at(i)->process();
+	}
+}
+
+
+
 
 void AITeamMember::addToTeam(int aiTeamNumber)
-{}
+{
+	//funktionniert nur so pseudomässig...
+	AIEngine* aiEngine=AIEngine::getInstance();
+	int teamNumber=aiEngine->newTeam();
+	aiEngine->getTeam(teamNumber)->addMember(this);
+}
 
+
+
+
+void AITeamMember::addModule(AIModule* newModule){
+		modules.push_back(newModule);
+}
Index: /branches/ai/src/ai/ai_team_member.h
===================================================================
--- /branches/ai/src/ai/ai_team_member.h	(revision 10040)
+++ /branches/ai/src/ai/ai_team_member.h	(revision 10041)
@@ -6,4 +6,5 @@
 #include "ai_module.h"
 
+
 class AITeamMember : public WorldEntity{
  public:
@@ -12,7 +13,8 @@
 
    void process();
-   void addToTeam(int aiTeamNumber);
+   void addToTeam(int);
+   void addModule(AIModule*);
  private:
-   std::vector<AIModule>          modules;
+   std::vector<AIModule*>          modules;
 };
 
Index: /branches/ai/src/ai/movement_module.cc
===================================================================
--- /branches/ai/src/ai/movement_module.cc	(revision 10040)
+++ /branches/ai/src/ai/movement_module.cc	(revision 10041)
@@ -27,5 +27,27 @@
 
 void MovementModule::process()
-{}
+{
+
+	//How does the Module know the AITeamMember it belongs to??
+	
+	/*Vector absPosition = this->getAbsCoor();
+
+	PRINTF(0)(" npc abs coor: %f, %f, %f\n", absPosition.x, absPosition.y, absPosition.z);
+
+	Player* pl = State::getPlayer();
+	Vector playerAbsPos = pl->getPlayable()->getAbsCoor();
+
+	PRINTF(0)(" player abs coor: %f, %f, %f\n", playerAbsPos.x, playerAbsPos.y, playerAbsPos.z);
 
 
+  // intelligent reaction
+
+	Vector distanceVector = playerAbsPos - absPosition;
+	distanceVector.normalize();
+
+	float speed = 10.0f;
+
+	this->shiftCoor( distanceVector * speed * dt);*/
+}
+
+
Index: /branches/ai/src/world_entities/npcs/npc.h
===================================================================
--- /branches/ai/src/world_entities/npcs/npc.h	(revision 10040)
+++ /branches/ai/src/world_entities/npcs/npc.h	(revision 10041)
@@ -4,8 +4,9 @@
 
 #include "world_entity.h"
+#include "ai_team_member.h"
 
 class AI;
 
-class NPC : public WorldEntity {
+class NPC : public AITeamMember {
   ObjectListDeclaration(NPC);
  public:
Index: /branches/ai/src/world_entities/npcs/npc_test.cc
===================================================================
--- /branches/ai/src/world_entities/npcs/npc_test.cc	(revision 10040)
+++ /branches/ai/src/world_entities/npcs/npc_test.cc	(revision 10041)
@@ -32,4 +32,5 @@
 
 #include "class_id_DEPRECATED.h"
+
 ObjectListDefinitionID(NPC2, CL_NPC_TEST2);
 CREATE_FACTORY(NPC2);
@@ -42,6 +43,7 @@
 
 
-  if (root != NULL)
-    this->loadParams(root);
+  if (root != NULL)this->loadParams(root);
+  
+  addToTeam(0);
 }
 
@@ -63,9 +65,12 @@
 void NPC2::tick(float dt)
 {
+	
+	
   // animating the md2 model (uninteressant)
   if( likely(this->getModel(0) != NULL))
     ((MD2Model*)this->getModel(0))->tick(dt);
 
-
+	return; 
+	//this things will now be managed by the AI modules..../////
 
   PRINTF(0)("====================\n");
