Index: code/branches/dockingsystem2/data/gui/scripts/DockingDialog.lua
===================================================================
--- code/branches/dockingsystem2/data/gui/scripts/DockingDialog.lua	(revision 8492)
+++ code/branches/dockingsystem2/data/gui/scripts/DockingDialog.lua	(revision 8493)
@@ -10,10 +10,10 @@
 
 function P.onShow()
-    orxonox.CommandExecutor:execute("pause")
+    orxonox.execute("setPause 1")
     P.update()
 end
 
 function P.onHide()
-    orxonox.CommandExecutor:execute("pause")
+    orxonox.execute("setPause 0")
 end
 
@@ -42,7 +42,5 @@
         local index = listbox:getItemIndex(choice)
         local dock = P.docks[index+1]
-        cout(0, index )--.. ": " .. P.docks[index])
         if dock ~= nil then
-            cout(0, "LUA>Docking")
             dock:dock()
         end
@@ -52,5 +50,4 @@
 
 function P.cancelButton_clicked(e)
-    --P.hideMe()
     hideMenuSheet(P.name)
 end
Index: code/branches/dockingsystem2/data/levels/docking.oxw
===================================================================
--- code/branches/dockingsystem2/data/levels/docking.oxw	(revision 8492)
+++ code/branches/dockingsystem2/data/levels/docking.oxw	(revision 8493)
@@ -35,11 +35,10 @@
 
 
-
     <Dock>
-        <animation>
+        <animations>
             <MoveToDockingTarget target="destroyer" position="10,150,40" />
-        </animation>
+        </animations>
         <effects>
-            <DockToShip target="destroyer" />
+            <DockToShip target="spaceShip" />
         </effects>
         <events>
@@ -49,5 +48,5 @@
         </events>
         <attached>
-            <DistanceTrigger position="0,0,0" distance="30" target="Pawn" beaconMode="exclude" targetname="destroyerBeacon" name="dockMe" />
+            <DistanceTrigger position="0,0,0" distance="30" target="Pawn" beaconMode="exclude" targetname="bcnSpaceShip" name="dockMe" />
             <Billboard material="Examples/Flare" colour="1.0, 0, 0" />
         </attached>
@@ -79,6 +78,6 @@
   >
     <attached>
-        <DistanceTriggerBeacon name="bcnSpaceShip1" />
-        <DockingTarget name="spaceShip1" />
+        <DistanceTriggerBeacon name="bcnSpaceShip" />
+        <DockingTarget name="spaceShip" />
 
       <Model position="0,0,0" yaw="90" pitch="-90" roll="0" scale="4" mesh="assff.mesh" />
Index: code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	(revision 8493)
@@ -2,5 +2,8 @@
   DockingTarget.cc
   DockingEffect.cc
+  DockingAnimation.cc
   DockToShip.cc
+  MoveToDockingTarget.cc
+  DockingController.cc
   Dock.cc
 )
Index: code/branches/dockingsystem2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	(revision 8493)
@@ -57,5 +57,4 @@
     {
         RegisterObject(Dock);
-        COUT(0) << "Registering dock..." << std::endl;
     }
 
@@ -70,7 +69,6 @@
 
         XMLPortObject(Dock, DockingEffect, "effects", addEffect, getEffect, xmlelement, mode);
+        XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode);
         XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
-
-        COUT(0) << "Dock created.." << std::endl;
     }
 
@@ -96,5 +94,7 @@
             }
             pawn = pTrigger->getTriggeringPlayer();
-        } else {
+        }
+        else
+        {
             COUT(2) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
             return false;
@@ -110,9 +110,7 @@
         if(player == NULL)
         {
-            COUT(2) << "The PlayerInfo* is NULL." << std::endl;
-            return false;
-        }
-
-        COUT(0) << "Dock triggered by player: " << player->getName() << ".." << std::endl;
+            COUT(2) << "Docking::execute The PlayerInfo* is NULL." << std::endl;
+            return false;
+        }
 
         if(bTriggered)
@@ -123,5 +121,4 @@
             // Show docking dialog
             GUIManager::showGUI("DockingDialog");
-            //DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
         }
         else
@@ -129,6 +126,4 @@
             // Remove player from candidates list
             candidates.erase(player);
-
-            //DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
         }
 
@@ -163,12 +158,28 @@
         if(candidates.find(player) == candidates.end())
         {
-            COUT(0) << "Player is not a candidate!" << std::endl;
-            return false;
-        }
-
-        // Remove player from candidates, add to docked players and invoke docking effect
+            COUT(0) << "Dock::dock Player is not a candidate!" << std::endl;
+            return false;
+        }
+
         candidates.erase(player);
         docked.insert(player);
-        DockingEffect::invokeEffect(docking::ATTACH, player, effects);
+
+        if (animations.empty())
+            return dockingAnimationFinished(player);
+        else
+            DockingAnimation::invokeAnimation(true, player, animations);
+
+        return true;
+    }
+
+    bool Dock::dockingAnimationFinished(PlayerInfo* player)
+    {
+        if(docked.find(player) == docked.end())
+        {
+            COUT(0) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl;
+            return false;
+        }
+
+        DockingEffect::invokeEffect(true, player, effects);
         return true;
     }
@@ -179,12 +190,23 @@
         if(docked.find(player) == docked.end())
         {
-            COUT(0) << "Player is not docked to this Dock." << std::endl;
-            return false;
-        }
-
-        // Remove player from docked, add to candidates and reverse DockingEffect 
+            COUT(0) << "Dock::undock Player is not docked to this Dock." << std::endl;
+            return false;
+        }
+
         docked.erase(player);
         candidates.insert(player);
-        DockingEffect::invokeEffect(docking::RELEASE, player, effects);
+
+        DockingEffect::invokeEffect(false, player, effects);
+
+        if (animations.empty())
+            return undockingAnimationFinished(player);
+        else
+            DockingAnimation::invokeAnimation(false, player, animations);
+
+        return true;
+    }
+
+    bool Dock::undockingAnimationFinished(PlayerInfo* player) {
+        COUT(0) << "Dock::undockingAnimationFinished executed" << std::endl;
         return true;
     }
@@ -226,7 +248,6 @@
     }
 
-    const DockingEffect* Dock::getEffect(unsigned int index) const
-    {
-        int i = index;
+    const DockingEffect* Dock::getEffect(unsigned int i) const
+    {
         for (std::list<DockingEffect*>::const_iterator effect = this->effects.begin(); effect != this->effects.end(); ++effect)
         {
@@ -237,3 +258,22 @@
         return NULL;
     }
+
+    bool Dock::addAnimation(DockingAnimation* animation)
+    {
+        assert(animation);
+        animation->setParent(this);
+        animations.push_back(animation);
+        return true;
+    }
+
+    const DockingAnimation* Dock::getAnimation(unsigned int i) const
+    {
+        for (std::list<DockingAnimation*>::const_iterator animation = this->animations.begin(); animation != this->animations.end(); ++animation)
+        {
+            if(i == 0)
+               return *animation;
+            i--;
+        }
+        return NULL;
+    }
 }
Index: code/branches/dockingsystem2/src/modules/docking/Dock.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.h	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.h	(revision 8493)
@@ -46,4 +46,5 @@
 
 #include "DockingEffect.h"
+#include "DockingAnimation.h"
 #include "DockingPrereqs.h"
 
@@ -58,19 +59,31 @@
         virtual ~Dock();
 
+        // Trigger interface
+        bool execute(bool bTriggered, BaseObject* trigger);
+
+        // XML interface
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
         virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
-        bool execute(bool bTriggered, BaseObject* trigger);
-
+        // XML functions
         bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
         const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
+        bool addAnimation(DockingAnimation* animation); //!< Add a DockingAnimation to the Dock.
+        const DockingAnimation* getAnimation(unsigned int index) const; //!< Get the DockingAnimation at a given index.
 
+        // Docking/undocking logic, checks conditions and invokes the DockingAnimations
         bool dock(PlayerInfo* player); //!< Returns true if given player docked successfully (player must be a candidate)
         bool undock(PlayerInfo* player); //!< Undocks a player (player must be docked)
 
+        // Animation logic
+        bool dockingAnimationFinished(PlayerInfo* player); //!< Called when a docking animation finished
+        bool undockingAnimationFinished(PlayerInfo* player); //!< Called when a undocking animation finished
+
+        // LUA interface
         void dock() { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); } // tolua_export
         static unsigned int getNumberOfActiveDocks(); // tolua_export
         static Dock* getActiveDockAtIndex(unsigned int index); // tolua_export
 
+        // Console commands
         static void cmdDock();
         static void cmdUndock();
@@ -79,5 +92,7 @@
         std::set<PlayerInfo*> candidates; //!< A set of all players which are allowed to dock using the console command.
         std::set<PlayerInfo*> docked; //!< A set of all docked players
+
         std::list<DockingEffect*> effects; //!< The list of DockingEffects to be executed when a player docks.
+        std::list<DockingAnimation*> animations; //!< The list of DockingAnimations to be executed before a player docks
     }; // tolua_export
 } // tolua_export
Index: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	(revision 8493)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      Damian 'Mozork' Frick
+ *      Sven Stucki
  *   Co-authors:
  *      ...
@@ -69,10 +69,4 @@
     bool DockToShip::docking(PlayerInfo* player)
     {
-        COUT(0) << "DockToShip::docking" << endl;
-        return true;
-    }
-
-    bool DockToShip::attach(PlayerInfo* player)
-    {
         COUT(0) << "DockToShip::attach" << endl;
 
Index: code/branches/dockingsystem2/src/modules/docking/DockToShip.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.h	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.h	(revision 8493)
@@ -61,11 +61,9 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void setTargetId(std::string str);
-            virtual std::string getTargetId();
+            void setTargetId(std::string str);
+            std::string getTargetId();
 
             virtual bool docking(PlayerInfo* player); //!< Called when docking starts
-            virtual bool attach(PlayerInfo* player); //!< Called after docking animation
             virtual bool release(PlayerInfo* player); //!< Called when player wants undock
-
         private:
             std::string target;
Index: code/branches/dockingsystem2/src/modules/docking/DockingAnimation.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingAnimation.cc	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/DockingAnimation.cc	(revision 8493)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockingAnimation.cc
+    @brief Implementation of the DockingAnimation class.
+*/
+
+#include "DockingAnimation.h"
+
+#include "DockingEffect.h"  // For DockingEffect::findTarget
+
+namespace orxonox
+{
+    DockingAnimation::DockingAnimation(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(DockingAnimation);
+    }
+
+    DockingAnimation::~DockingAnimation()
+    {
+
+    }
+
+    bool DockingAnimation::invokeAnimation(bool dock, PlayerInfo* player, std::list<DockingAnimation*> &animations)
+    {
+        bool check = true;
+
+        for (std::list<DockingAnimation*>::iterator animation = animations.begin(); animation != animations.end(); animation++)
+        {
+            if(dock)
+                check &= (*animation)->docking(player);
+            else
+                check &= (*animation)->release(player);
+        }
+
+        return check;
+    }
+
+    DockingTarget *DockingAnimation::findTarget(std::string name) {
+        return DockingEffect::findTarget(name);
+    }
+}
Index: code/branches/dockingsystem2/src/modules/docking/DockingAnimation.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingAnimation.h	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/DockingAnimation.h	(revision 8493)
@@ -0,0 +1,84 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockingAnimation.h
+    @brief Definition of the DockingAnimation class.
+    @ingroup Docking
+*/
+
+#ifndef _DockingAnimation_H__
+#define _DockingAnimation_H__
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "infos/PlayerInfo.h"
+
+#include "DockingPrereqs.h"
+#include "DockingTarget.h"
+#include "Dock.h"
+
+
+#include <list>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Base class for docking animations used by @ref orxonox::Docking "Docks".
+
+    @author
+        Sven Stucki
+
+    @ingroup Docking
+    */
+    class _DockingExport DockingAnimation : public BaseObject
+    {
+        public:
+            DockingAnimation(BaseObject* creator);
+            virtual ~DockingAnimation();
+
+            virtual bool docking(PlayerInfo* player) = 0; //!< Called when a player starts docking
+            virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants to undock
+
+            static bool invokeAnimation(bool dock, PlayerInfo* player, std::list<DockingAnimation*> &animations); //!< Invokes calls the docking or release method of all list entries
+            static DockingTarget *findTarget(std::string name); //!< Iterates through all DockingTarget objects to find the one with name=target
+
+            void setParent(Dock *parent) { this->parent = parent; }
+
+        protected:
+            Dock *parent;
+            std::set<PlayerInfo*> animations; //!< Contains a list of currently running animations
+    };
+
+}
+
+#endif /* _DockingAnimation_H__ */
Index: code/branches/dockingsystem2/src/modules/docking/DockingController.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingController.cc	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/DockingController.cc	(revision 8493)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DockingController.h"
+
+#include "Dock.h"
+
+
+namespace orxonox
+{
+    CreateFactory(DockingController);
+
+    DockingController::DockingController(BaseObject* creator) : ArtificialController(creator)
+    {
+        RegisterObject(DockingController);
+    }
+
+    DockingController::~DockingController()
+    {
+
+    }
+
+    void DockingController::tick(float dt)
+    {
+        this->moveToTargetPosition();
+
+        SUPER(DockingController, tick, dt);
+    }
+
+    void DockingController::positionReached()
+    {
+        // TODO; Give control back to player
+
+        if (docking)
+            dock->dockingAnimationFinished(player);
+        else
+            dock->undockingAnimationFinished(player);
+    }
+}
Index: code/branches/dockingsystem2/src/modules/docking/DockingController.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingController.h	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/DockingController.h	(revision 8493)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DockingController_H__
+#define _DockingController_H__
+
+#include "DockingPrereqs.h"
+
+#include "infos/PlayerInfo.h"
+#include "controllers/ArtificialController.h"
+#include "tools/interfaces/Tickable.h"
+#include "DockingController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DockingController : public ArtificialController, public Tickable
+    {
+        public:
+            DockingController(BaseObject* creator);
+            virtual ~DockingController();
+
+            virtual void tick(float dt);
+
+            void takeControl(bool docking);
+
+            void setDock(Dock* dock) { this->dock = dock; }
+            void setEntity(ControllableEntity* entity) { this->entity = entity; }
+
+        protected:
+            virtual void positionReached();
+
+        private:
+            Dock* dock;
+            bool docking;
+            ControllableEntity* entity;
+    };
+}
+
+#endif /* _DockingController_H__ */
Index: code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	(revision 8493)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      Damian 'Mozork' Frick
+ *      Sven Stucki
  *   Co-authors:
  *      ...
@@ -46,23 +46,14 @@
     }
 
-    bool DockingEffect::invokeEffect(docking::event event, PlayerInfo* player, std::list<DockingEffect*> & effects)
+    bool DockingEffect::invokeEffect(bool dock, PlayerInfo* player, std::list<DockingEffect*> & effects)
     {
         bool check = true;
 
-        COUT(4) << "Invoking DockingEffects on player: " << player << " ."  << std::endl;
-
         for (std::list<DockingEffect*>::iterator effect = effects.begin(); effect != effects.end(); effect++)
         {
-            switch(event)
-            {
-                case docking::DOCKING:
-                    check &= (*effect)->docking(player);
-                    break;
-                case docking::RELEASE:
-                    check &= (*effect)->release(player);
-                    break;
-                default:
-                    assert(0);
-            }
+            if (dock)
+                check &= (*effect)->docking(player);
+            else
+                check &= (*effect)->release(player);
         }
 
Index: code/branches/dockingsystem2/src/modules/docking/DockingEffect.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	(revision 8493)
@@ -49,10 +49,4 @@
 namespace orxonox
 {
-    namespace docking {
-        enum event {
-            DOCKING,
-            RELEASE
-        };
-    }
 
     /**
@@ -74,5 +68,5 @@
             virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants to undock
 
-            static bool invokeEffect(docking::event event, PlayerInfo* player, std::list<DockingEffect*> & effects); //!< Invokes the event specific method of all DockingEffects in the list
+            static bool invokeEffect(bool dock, PlayerInfo* player, std::list<DockingEffect*> & effects); //!< Invokes the event specific method of all DockingEffects in the list
             static DockingTarget *findTarget(std::string name); //!< Iterates through all DockingTarget objects to find the one with name=target
     };
Index: code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	(revision 8492)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	(revision 8493)
@@ -66,7 +66,9 @@
 {
     class Dock;
+    class DockingAnimation;
     class DockingTarget;
     class DockingEffect;
     class DockToShip;
+    class MoveToDockingTarget;
 }
 
Index: code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.cc	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.cc	(revision 8493)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file MoveToDockingTarget.h
+    @brief Definition of the MoveToDockingTarget class.
+    @ingroup Docking
+*/
+
+#include "MoveToDockingTarget.h"
+
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(MoveToDockingTarget);
+
+    MoveToDockingTarget::MoveToDockingTarget(BaseObject *creator) : DockingAnimation(creator)
+    {
+        RegisterObject(MoveToDockingTarget);
+    }
+
+    MoveToDockingTarget::~MoveToDockingTarget() {
+
+    }
+
+    bool MoveToDockingTarget::docking(PlayerInfo *player)
+    {
+        assert(parent);
+        parent->dockingAnimationFinished(player);
+        return true;
+    }
+
+    bool MoveToDockingTarget::release(PlayerInfo *player)
+    {
+        assert(parent);
+        parent->undockingAnimationFinished(player);
+        return true;
+    }
+
+}
Index: code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.h
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.h	(revision 8493)
+++ code/branches/dockingsystem2/src/modules/docking/MoveToDockingTarget.h	(revision 8493)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sven Stucki
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file MoveToDockingTarget.h
+    @brief Definition of the MoveToDockingTarget class.
+    @ingroup Docking
+*/
+
+#ifndef _MoveToDockingTarget_H__
+#define _MoveToDockingTarget_H__
+
+#include "DockingPrereqs.h"
+#include "DockingAnimation.h"
+#include "Dock.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Base class for docking animations used by @ref orxonox::Docking "Docks".
+
+    @author
+        Sven Stucki
+
+    @ingroup Docking
+    */
+    class _DockingExport MoveToDockingTarget : public DockingAnimation
+    {
+        public:
+            MoveToDockingTarget(BaseObject* creator);
+            virtual ~MoveToDockingTarget();
+
+            virtual bool docking(PlayerInfo* player); //!< Called when a player starts docking
+            virtual bool release(PlayerInfo* player); //!< Called when player wants to undock
+    };
+
+}
+
+#endif /* _MoveToDockingTarget_H__ */
Index: code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.cc	(revision 8492)
+++ code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.cc	(revision 8493)
@@ -381,4 +381,9 @@
             }
         }
+
+        if (distance < 10)
+        {
+            this->positionReached();
+        }
     }
 
@@ -386,4 +391,9 @@
     {
         this->moveToPosition(this->targetPosition_);
+    }
+
+    void ArtificialController::positionReached()
+    {
+        // Override me !
     }
 
Index: code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.h	(revision 8492)
+++ code/branches/dockingsystem2/src/orxonox/controllers/ArtificialController.h	(revision 8493)
@@ -97,4 +97,6 @@
             void moveToTargetPosition();
 
+            virtual void positionReached();
+
             void removeFromFormation();
             void unregisterSlave();
