[Orxonox-commit 3510] r8196 - in code/branches/dockingsystem2: . data/levels src/modules src/modules/docking src/orxonox/infos

dafrick at orxonox.net dafrick at orxonox.net
Wed Apr 6 16:39:37 CEST 2011


Author: dafrick
Date: 2011-04-06 16:39:29 +0200 (Wed, 06 Apr 2011)
New Revision: 8196

Added:
   code/branches/dockingsystem2/data/levels/docking.oxw
   code/branches/dockingsystem2/src/modules/docking/
   code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt
   code/branches/dockingsystem2/src/modules/docking/Dock.cc
   code/branches/dockingsystem2/src/modules/docking/Dock.h
   code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
   code/branches/dockingsystem2/src/modules/docking/DockToShip.h
   code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc
   code/branches/dockingsystem2/src/modules/docking/DockingEffect.h
   code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h
   code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h
Removed:
   code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt
   code/branches/dockingsystem2/src/modules/docking/Dock.cc
   code/branches/dockingsystem2/src/modules/docking/Dock.h
   code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
   code/branches/dockingsystem2/src/modules/docking/DockToShip.h
   code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc
   code/branches/dockingsystem2/src/modules/docking/DockingEffect.h
   code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h
   code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h
Modified:
   code/branches/dockingsystem2/
   code/branches/dockingsystem2/src/modules/CMakeLists.txt
   code/branches/dockingsystem2/src/orxonox/infos/HumanPlayer.h
   code/branches/dockingsystem2/src/orxonox/infos/PlayerInfo.cc
Log:
Merging old dockingsystem branch into new one.
Do 
svn switch https://svn.orxonox.net/game/code/branches/dockingsystem2 
in your old branch.



Property changes on: code/branches/dockingsystem2
___________________________________________________________________
Modified: svn:mergeinfo
   - /code/branches/ai:6592-7033
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7975-7977
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/tetris:8100-8107
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
   + /code/branches/ai:6592-7033
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7975-7977
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/tetris:8100-8107
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890

Copied: code/branches/dockingsystem2/data/levels/docking.oxw (from rev 8192, code/branches/dockingsystem/data/levels/docking.oxw)
===================================================================
--- code/branches/dockingsystem2/data/levels/docking.oxw	                        (rev 0)
+++ code/branches/dockingsystem2/data/levels/docking.oxw	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,152 @@
+<LevelInfo
+ name = "Transporter"
+ description = "Level with a Transporter. Demostrates the docking system."
+ tags = ""
+/>
+
+<?lua
+  include("HUDTemplates3.oxo")
+  include("stats.oxo")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/lodInformation.oxt")
+?>
+
+<Level
+ name         = "Transporter"
+ description  = "Docking example level"
+>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+
+  <Scene
+   ambientlight = "0.5, 0.5, 0.5"
+   skybox       = "Orxonox/skypanoramagen1"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+
+    <?lua for i = 1, 10, 1 do ?>
+      <SpawnPoint position="<?lua print(math.random() * 500 - 250) ?>,<?lua print(math.random() * 500 - 250) ?>,<?lua print(math.random() * 500 - 250) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+    <?lua end ?>
+
+
+    <Dock>
+        <effects>
+            <DockToShip />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="dockMe" />
+            </execute>
+        </events>
+        <attached>
+            <DistanceTrigger position="0,0,0" distance="20" target="Pawn" name="dockMe" />
+            <Billboard material="Examples/Flare" colour="1.0, 0, 0" />
+        </attached>
+    </Dock>
+
+
+    
+    <Destroyer
+      position          = "100,150,0"
+      collisionType     = dynamic
+      mass              = 100000
+      velocity          = "0,0,0"
+      angularDamping    = 0.9999999
+      health            = 10000
+      maxhealth         = 10000
+      initialhealth     = 10000
+    >
+
+      <attached>
+        <TeamSpawnPoint team=1 position="150,0,7" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="0,0,7" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="-50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="100,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <TeamSpawnPoint team=1 position="50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
+        <?lua for i = 1, 100, 1 do ?>
+          <TeamSpawnPoint
+            team=0
+            position="<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>"
+            lookat="0,0,0"
+            spawnclass=SpaceShip
+            pawndesign=spaceshipassff
+          />
+        <?lua end ?>
+
+        <Model mesh="Carrier.mesh" scale="5" />
+        <Backlight
+          mainstate=activity
+          active=false
+          scale=0.4
+          name=bltest
+          position=" 7.6, 0, 6"
+          colour="0.2, 0.65, 1.0, 1.0"
+          width=15
+          length=1500
+          lifetime=2
+          elements=50
+          trailmaterial="Trail/backlighttrail"
+          turnontime=1
+          turnofftime=1
+          material="Flares/ThrusterFlare1"
+        />
+        <?lua for i=0,8,1 do ?>
+          <BlinkingBillboard
+            position="<?lua print(200-270/8*i)?> ,15,2"
+            material="Examples/Flare"
+            colour="1.0, 0.5, 0.3"
+            phase="<?lua print(-360/8*i)?>"
+            amplitude=0.1
+            frequency=0.5
+            quadratic=1
+          />
+
+          <BlinkingBillboard
+            position="<?lua print(200-270/8*i)?>,-15,2"
+            material="Examples/Flare"
+            colour="1.0, 0.5, 0.3"
+            phase="<?lua print(-360/8*i)?>"
+            amplitude=0.1
+            frequency=0.5
+            quadratic=1
+          />
+        <?lua end ?>
+
+        <Backlight
+          scale=1
+          position=" 169, 75, -15"
+          colour="1, 0.85, 0.5, 0.5"
+          width=40
+          length=1000
+          lifetime=5
+          elements=15
+          trailmaterial="Trail/backlighttrail"
+          material="Examples/Flare"
+        />
+        <Backlight
+          scale=1
+          position=" 169, -75, -15"
+          colour="1, 0.85, 0.5, 0.5"
+          width=40
+          length=1000
+          lifetime=5
+          elements=15
+          trailmaterial="Trail/backlighttrail"
+          material="Examples/Flare" />
+      </attached>
+      <collisionShapes>
+        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
+        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
+        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
+        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
+        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
+        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
+        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
+      </collisionShapes>
+    </Destroyer>
+    
+
+  </Scene>
+</Level>

Modified: code/branches/dockingsystem2/src/modules/CMakeLists.txt
===================================================================
--- code/branches/dockingsystem2/src/modules/CMakeLists.txt	2011-04-06 14:26:26 UTC (rev 8195)
+++ code/branches/dockingsystem2/src/modules/CMakeLists.txt	2011-04-06 14:39:29 UTC (rev 8196)
@@ -33,3 +33,4 @@
 ADD_SUBDIRECTORY(pong)
 ADD_SUBDIRECTORY(questsystem)
 ADD_SUBDIRECTORY(weapons)
+ADD_SUBDIRECTORY(docking)

Deleted: code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt
===================================================================
--- code/branches/dockingsystem/src/modules/docking/CMakeLists.txt	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,16 +0,0 @@
-SET_SOURCE_FILES(DOCKING_SRC_FILES
-  DockingEffect.cc
-  DockToShip.cc
-  Dock.cc
-)
-
-ORXONOX_ADD_LIBRARY(docking
-  MODULE
-  FIND_HEADER_FILES
-  TOLUA_FILES
-  PCH_FILE
-    DockingPrecompiledHeaders.h
-  LINK_LIBRARIES
-    orxonox
-  SOURCE_FILES ${DOCKING_SRC_FILES}
-)

Copied: code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt (from rev 8192, code/branches/dockingsystem/src/modules/docking/CMakeLists.txt)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/CMakeLists.txt	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,16 @@
+SET_SOURCE_FILES(DOCKING_SRC_FILES
+  DockingEffect.cc
+  DockToShip.cc
+  Dock.cc
+)
+
+ORXONOX_ADD_LIBRARY(docking
+  MODULE
+  FIND_HEADER_FILES
+  TOLUA_FILES
+  PCH_FILE
+    DockingPrecompiledHeaders.h
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${DOCKING_SRC_FILES}
+)

Deleted: code/branches/dockingsystem2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/dockingsystem/src/modules/docking/Dock.cc	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,146 +0,0 @@
-/*
- *   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 Dock.cc
-	@brief Docking system main class
-*/
-
-#include "Dock.h"
-#include "infos/HumanPlayer.h"
-#include "worldentities/pawns/Pawn.h"
-#include "interfaces/PlayerTrigger.h"
-
-
-namespace orxonox
-{
-    CreateFactory(Dock);
-
-    Dock::Dock(BaseObject* creator) : StaticEntity(creator)
-    {
-        RegisterObject(Dock);
-        COUT(0) << "Registering dock..." << std::endl;
-    }
-
-    Dock::~Dock()
-    {
-    }
-
-
-    void Dock::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Dock, XMLPort, xmlelement, mode);
-
-        XMLPortObject(Dock, DockingEffect, "effects", addEffect, getEffect, xmlelement, mode);
-        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
-
-        COUT(0) << "Dock created.." << std::endl;
-    }
-
-    void Dock::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Dock, XMLEventPort, xmlelement, mode);
-
-        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
-    }
-
-
-    bool Dock::execute(bool bTriggered, BaseObject* trigger)
-    {
-        //TODO: Handle DistanceMultiTrigger
-
-        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
-        Pawn* pawn = NULL;
-
-        // Check whether it is a player trigger and extract pawn from it
-        if(pTrigger != NULL)
-        {
-            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
-                COUT(0) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
-                return false;
-            }
-            pawn = pTrigger->getTriggeringPlayer();
-        } else {
-            COUT(0) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
-            return false;
-        }
-        if(pawn == NULL)
-        {
-            COUT(0) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
-            return false;
-        }
-
-        // Extract the PlayerInfo from the Pawn.
-        PlayerInfo* player = pawn->getPlayer();
-        if(player == NULL)
-        {
-            COUT(0) << "The PlayerInfo* is NULL." << std::endl;
-            return false;
-        }
-
-        // Try to get HumanPlayer
-        if(!player->isHumanPlayer()) {
-            COUT(0) << "Docking::execute Not triggered by a human." << std::endl;
-            return false;
-        }
-        HumanPlayer* human = orxonox_cast<HumanPlayer*>(player);
-        if(human == NULL) {
-            COUT(0) << "Docking::execute Player was not as human as expected.." << std::endl;
-        }
-        COUT(0) << "Dock triggered by player: " << human->getNick() << ".." << std::endl;
-
-        //TODO: This is waaay too oversimplified
-        if(bTriggered) {
-            DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
-            //DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
-        } else {
-            DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
-        }
-
-        return true;
-    }
-
-
-    bool Dock::addEffect(DockingEffect* effect) {
-        assert(effect);
-        effects_.push_back(effect);
-        return true;
-    }
-
-    const DockingEffect* Dock::getEffect(unsigned int index) const {
-        int i = index;
-        for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
-        {
-            if(i == 0)
-               return *effect;
-
-            i--;
-        }
-        return NULL;
-    }
-}

Copied: code/branches/dockingsystem2/src/modules/docking/Dock.cc (from rev 8192, code/branches/dockingsystem/src/modules/docking/Dock.cc)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.cc	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,146 @@
+/*
+ *   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 Dock.cc
+	@brief Docking system main class
+*/
+
+#include "Dock.h"
+#include "infos/HumanPlayer.h"
+#include "worldentities/pawns/Pawn.h"
+#include "interfaces/PlayerTrigger.h"
+
+
+namespace orxonox
+{
+    CreateFactory(Dock);
+
+    Dock::Dock(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Dock);
+        COUT(0) << "Registering dock..." << std::endl;
+    }
+
+    Dock::~Dock()
+    {
+    }
+
+
+    void Dock::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Dock, XMLPort, xmlelement, mode);
+
+        XMLPortObject(Dock, DockingEffect, "effects", addEffect, getEffect, xmlelement, mode);
+        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
+
+        COUT(0) << "Dock created.." << std::endl;
+    }
+
+    void Dock::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Dock, XMLEventPort, xmlelement, mode);
+
+        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
+    }
+
+
+    bool Dock::execute(bool bTriggered, BaseObject* trigger)
+    {
+        //TODO: Handle DistanceMultiTrigger
+
+        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
+        Pawn* pawn = NULL;
+
+        // Check whether it is a player trigger and extract pawn from it
+        if(pTrigger != NULL)
+        {
+            if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
+                COUT(0) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
+                return false;
+            }
+            pawn = pTrigger->getTriggeringPlayer();
+        } else {
+            COUT(0) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
+            return false;
+        }
+        if(pawn == NULL)
+        {
+            COUT(0) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
+            return false;
+        }
+
+        // Extract the PlayerInfo from the Pawn.
+        PlayerInfo* player = pawn->getPlayer();
+        if(player == NULL)
+        {
+            COUT(0) << "The PlayerInfo* is NULL." << std::endl;
+            return false;
+        }
+
+        // Try to get HumanPlayer
+        if(!player->isHumanPlayer()) {
+            COUT(0) << "Docking::execute Not triggered by a human." << std::endl;
+            return false;
+        }
+        HumanPlayer* human = orxonox_cast<HumanPlayer*>(player);
+        if(human == NULL) {
+            COUT(0) << "Docking::execute Player was not as human as expected.." << std::endl;
+        }
+        COUT(0) << "Dock triggered by player: " << human->getNick() << ".." << std::endl;
+
+        //TODO: This is waaay too oversimplified
+        if(bTriggered) {
+            DockingEffect::invokeEffect(docking::DOCKING, player, effects_);
+            //DockingEffect::invokeEffect(docking::ATTACH, player, effects_);
+        } else {
+            DockingEffect::invokeEffect(docking::RELEASE, player, effects_);
+        }
+
+        return true;
+    }
+
+
+    bool Dock::addEffect(DockingEffect* effect) {
+        assert(effect);
+        effects_.push_back(effect);
+        return true;
+    }
+
+    const DockingEffect* Dock::getEffect(unsigned int index) const {
+        int i = index;
+        for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
+        {
+            if(i == 0)
+               return *effect;
+
+            i--;
+        }
+        return NULL;
+    }
+}

Deleted: code/branches/dockingsystem2/src/modules/docking/Dock.h
===================================================================
--- code/branches/dockingsystem/src/modules/docking/Dock.h	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,69 +0,0 @@
-/*
- *   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 Dock.h
-    @brief Definition of Dock class
-    @ingroup Docking
-*/
-
-#ifndef _Dock_H__
-#define _Dock_H__
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "core/EventIncludes.h"
-
-#include "worldentities/StaticEntity.h"
-#include "DockingEffect.h"
-#include "DockingPrereqs.h"
-
-namespace orxonox { 
-
-
-    class _DockingExport Dock : public StaticEntity {
-    public:
-        Dock(BaseObject* creator);
-        virtual ~Dock();
-
-        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
-
-        bool execute(bool bTriggered, BaseObject* trigger);
-
-        bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
-        const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
-
-    private:
-        std::list<DockingEffect*> effects_; //!< The list of DockingEffects to be executed when a player docks.
-    };
-
-
-}
-
-#endif /* _Dock_H__ */

Copied: code/branches/dockingsystem2/src/modules/docking/Dock.h (from rev 8192, code/branches/dockingsystem/src/modules/docking/Dock.h)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.h	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,69 @@
+/*
+ *   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 Dock.h
+    @brief Definition of Dock class
+    @ingroup Docking
+*/
+
+#ifndef _Dock_H__
+#define _Dock_H__
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+
+#include "worldentities/StaticEntity.h"
+#include "DockingEffect.h"
+#include "DockingPrereqs.h"
+
+namespace orxonox { 
+
+
+    class _DockingExport Dock : public StaticEntity {
+    public:
+        Dock(BaseObject* creator);
+        virtual ~Dock();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+        bool execute(bool bTriggered, BaseObject* trigger);
+
+        bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
+        const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
+
+    private:
+        std::list<DockingEffect*> effects_; //!< The list of DockingEffects to be executed when a player docks.
+    };
+
+
+}
+
+#endif /* _Dock_H__ */

Deleted: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockToShip.cc	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,70 +0,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file DockToShip.cc
-    @brief Implementation of the DockToShip class.
-*/
-
-#include "DockingEffect.h"
-#include "DockToShip.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    CreateFactory(DockToShip);
-
-    DockToShip::DockToShip(BaseObject* creator) : DockingEffect(creator)
-    {
-        RegisterObject(DockToShip);
-        COUT(0) << "DockToShip instance created.." << endl;
-    }
-
-    DockToShip::~DockToShip()
-    {
-
-    }
-
-    bool DockToShip::docking(PlayerInfo* player)
-    {
-        COUT(0) << "DockToShip::docking" << endl;
-        return true;
-    }
-
-    bool DockToShip::attach(PlayerInfo* player)
-    {
-        COUT(0) << "DockToShip::attach" << endl;
-        return true;
-    }
-
-    bool DockToShip::release(PlayerInfo* player)
-    {
-        COUT(0) << "DockToShip::release" << endl;
-        return true;
-    }
-}

Copied: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockToShip.cc)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,70 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockToShip.cc
+    @brief Implementation of the DockToShip class.
+*/
+
+#include "DockingEffect.h"
+#include "DockToShip.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(DockToShip);
+
+    DockToShip::DockToShip(BaseObject* creator) : DockingEffect(creator)
+    {
+        RegisterObject(DockToShip);
+        COUT(0) << "DockToShip instance created.." << endl;
+    }
+
+    DockToShip::~DockToShip()
+    {
+
+    }
+
+    bool DockToShip::docking(PlayerInfo* player)
+    {
+        COUT(0) << "DockToShip::docking" << endl;
+        return true;
+    }
+
+    bool DockToShip::attach(PlayerInfo* player)
+    {
+        COUT(0) << "DockToShip::attach" << endl;
+        return true;
+    }
+
+    bool DockToShip::release(PlayerInfo* player)
+    {
+        COUT(0) << "DockToShip::release" << endl;
+        return true;
+    }
+}

Deleted: code/branches/dockingsystem2/src/modules/docking/DockToShip.h
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockToShip.h	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,67 +0,0 @@
-/*
- *   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 DockToShip.h
-    @brief DockingEffect which transfers control from spaceship to docked ship ASDF
-    @ingroup Docking
-*/
-
-#ifndef _DockToShip_H__
-#define _DockToShip_H__
-
-#include "DockingPrereqs.h"
-#include "DockToShip.h"
-
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        Allows players to dock onto a ship
-
-    @author
-        Sven Stucki
-
-    @ingroup Docking
-    */
-    class _DockingExport DockToShip : public DockingEffect
-    {
-        public:
-            DockToShip(BaseObject* creator);
-            virtual ~DockToShip();
-
-            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
-    };
-
-}
-
-#endif /* _DockToShip_H__ */

Copied: code/branches/dockingsystem2/src/modules/docking/DockToShip.h (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockToShip.h)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.h	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,67 @@
+/*
+ *   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 DockToShip.h
+    @brief DockingEffect which transfers control from spaceship to docked ship ASDF
+    @ingroup Docking
+*/
+
+#ifndef _DockToShip_H__
+#define _DockToShip_H__
+
+#include "DockingPrereqs.h"
+#include "DockToShip.h"
+
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Allows players to dock onto a ship
+
+    @author
+        Sven Stucki
+
+    @ingroup Docking
+    */
+    class _DockingExport DockToShip : public DockingEffect
+    {
+        public:
+            DockToShip(BaseObject* creator);
+            virtual ~DockToShip();
+
+            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
+    };
+
+}
+
+#endif /* _DockToShip_H__ */

Deleted: code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockingEffect.cc	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,73 +0,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file DockingEffect.cc
-    @brief Implementation of the DockingEffect class.
-*/
-
-#include "DockingEffect.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    DockingEffect::DockingEffect(BaseObject* creator) : BaseObject(creator)
-    {
-        RegisterObject(DockingEffect);
-    }
-
-    DockingEffect::~DockingEffect()
-    {
-
-    }
-
-    bool DockingEffect::invokeEffect(docking::event event, 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::ATTACH:
-                    check &= (*effect)->attach(player);
-                    break;
-                case docking::RELEASE:
-                    check &= (*effect)->release(player);
-                    break;
-                default:
-                    assert(0);
-            }
-        }
-
-        return check;
-    }
-}

Copied: code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockingEffect.cc)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,73 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DockingEffect.cc
+    @brief Implementation of the DockingEffect class.
+*/
+
+#include "DockingEffect.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    DockingEffect::DockingEffect(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(DockingEffect);
+    }
+
+    DockingEffect::~DockingEffect()
+    {
+
+    }
+
+    bool DockingEffect::invokeEffect(docking::event event, 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::ATTACH:
+                    check &= (*effect)->attach(player);
+                    break;
+                case docking::RELEASE:
+                    check &= (*effect)->release(player);
+                    break;
+                default:
+                    assert(0);
+            }
+        }
+
+        return check;
+    }
+}

Deleted: code/branches/dockingsystem2/src/modules/docking/DockingEffect.h
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockingEffect.h	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,77 +0,0 @@
-/*
- *   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 DockingEffect.h
-    @brief Definition of the DockingEffect class.
-    @ingroup Docking
-*/
-
-#ifndef _DockingEffect_H__
-#define _DockingEffect_H__
-
-#include "DockingPrereqs.h"
-
-#include <list>
-#include "core/BaseObject.h"
-
-namespace orxonox
-{
-    namespace docking {
-        enum event {
-            DOCKING,
-            ATTACH,
-            RELEASE
-        };
-    }
-
-    /**
-    @brief
-        Handles DockingEffects for @ref orxonox::Docking "Docks".
-
-    @author
-        Sven Stucki
-
-    @ingroup Docking
-    */
-    class _DockingExport DockingEffect : public BaseObject
-    {
-        public:
-            DockingEffect(BaseObject* creator);
-            virtual ~DockingEffect();
-
-            virtual bool docking(PlayerInfo* player) = 0; //!< Called when docking starts
-            virtual bool attach(PlayerInfo* player) = 0; //!< Called after docking animation
-            virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants undock
-
-            static bool invokeEffect(docking::event event, PlayerInfo* player, std::list<DockingEffect*> & effects); //!< Invokes the event specific method of all DockingEffects in the list
-    };
-
-}
-
-#endif /* _DockingEffect_H__ */

Copied: code/branches/dockingsystem2/src/modules/docking/DockingEffect.h (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockingEffect.h)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockingEffect.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,77 @@
+/*
+ *   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 DockingEffect.h
+    @brief Definition of the DockingEffect class.
+    @ingroup Docking
+*/
+
+#ifndef _DockingEffect_H__
+#define _DockingEffect_H__
+
+#include "DockingPrereqs.h"
+
+#include <list>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    namespace docking {
+        enum event {
+            DOCKING,
+            ATTACH,
+            RELEASE
+        };
+    }
+
+    /**
+    @brief
+        Handles DockingEffects for @ref orxonox::Docking "Docks".
+
+    @author
+        Sven Stucki
+
+    @ingroup Docking
+    */
+    class _DockingExport DockingEffect : public BaseObject
+    {
+        public:
+            DockingEffect(BaseObject* creator);
+            virtual ~DockingEffect();
+
+            virtual bool docking(PlayerInfo* player) = 0; //!< Called when docking starts
+            virtual bool attach(PlayerInfo* player) = 0; //!< Called after docking animation
+            virtual bool release(PlayerInfo* player) = 0; //!< Called when player wants undock
+
+            static bool invokeEffect(docking::event event, PlayerInfo* player, std::list<DockingEffect*> & effects); //!< Invokes the event specific method of all DockingEffects in the list
+    };
+
+}
+
+#endif /* _DockingEffect_H__ */

Deleted: code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockingPrecompiledHeaders.h	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,53 +0,0 @@
-/*
- *   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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
- at file
- at brief
-*/
-
-#include "OrxonoxConfig.h"
-
-///////////////////////////////////////////
-/////          Stable Headers         /////
-///////////////////////////////////////////
-
-#include <LinearMath/btTransform.h>
-
-///////////////////////////////////////////
-/////       All Rebuild Headers       /////
-///////////////////////////////////////////
-
-#include "core/BaseObject.h"
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-
-
-// Just in case some header included windows.h
-#undef min
-#undef max

Copied: code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockingPrecompiledHeaders.h)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrecompiledHeaders.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ at file
+ at brief
+*/
+
+#include "OrxonoxConfig.h"
+
+///////////////////////////////////////////
+/////          Stable Headers         /////
+///////////////////////////////////////////
+
+#include <LinearMath/btTransform.h>
+
+///////////////////////////////////////////
+/////       All Rebuild Headers       /////
+///////////////////////////////////////////
+
+#include "core/BaseObject.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+
+// Just in case some header included windows.h
+#undef min
+#undef max

Deleted: code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h
===================================================================
--- code/branches/dockingsystem/src/modules/docking/DockingPrereqs.h	2011-04-04 14:53:58 UTC (rev 8192)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -1,72 +0,0 @@
-/*
- *   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:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
- at file
- at brief
-    Shared library macros, enums, constants and forward declarations for the questsystem module
-*/
-
-#ifndef _DockingPrereqs_H__
-#define _DockingPrereqs_H__
-
-#include "OrxonoxConfig.h"
-#include "OrxonoxPrereqs.h"
-
-//-----------------------------------------------------------------------
-// Shared library settings
-//-----------------------------------------------------------------------
-
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Docking_STATIC_BUILD)
-#  ifdef Docking_SHARED_BUILD
-#    define _DockingExport __declspec(dllexport)
-#  else
-#    if defined( __MINGW32__ )
-#      define _DockingExport
-#    else
-#      define _DockingExport __declspec(dllimport)
-#    endif
-#  endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
-#  define _DockingExport  __attribute__ ((visibility("default")))
-#else
-#  define _DockingExport
-#endif
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-namespace orxonox
-{
-    class Dock;
-    class DockingEffect;
-    class DockToShip;
-}
-
-#endif /* _DockingPrereqs_H__ */

Copied: code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h (from rev 8192, code/branches/dockingsystem/src/modules/docking/DockingPrereqs.h)
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	                        (rev 0)
+++ code/branches/dockingsystem2/src/modules/docking/DockingPrereqs.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -0,0 +1,72 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ at file
+ at brief
+    Shared library macros, enums, constants and forward declarations for the questsystem module
+*/
+
+#ifndef _DockingPrereqs_H__
+#define _DockingPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Docking_STATIC_BUILD)
+#  ifdef Docking_SHARED_BUILD
+#    define _DockingExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _DockingExport
+#    else
+#      define _DockingExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _DockingExport  __attribute__ ((visibility("default")))
+#else
+#  define _DockingExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class Dock;
+    class DockingEffect;
+    class DockToShip;
+}
+
+#endif /* _DockingPrereqs_H__ */

Modified: code/branches/dockingsystem2/src/orxonox/infos/HumanPlayer.h
===================================================================
--- code/branches/dockingsystem2/src/orxonox/infos/HumanPlayer.h	2011-04-06 14:26:26 UTC (rev 8195)
+++ code/branches/dockingsystem2/src/orxonox/infos/HumanPlayer.h	2011-04-06 14:39:29 UTC (rev 8196)
@@ -48,6 +48,9 @@
             float getPing() const;
             float getPacketLossRatio() const;
 
+            inline const std::string& getNick() const
+                { return this->nick_; }
+
             void setClientID(unsigned int clientID);
 
             virtual void changedGametype();

Modified: code/branches/dockingsystem2/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/dockingsystem2/src/orxonox/infos/PlayerInfo.cc	2011-04-06 14:26:26 UTC (rev 8195)
+++ code/branches/dockingsystem2/src/orxonox/infos/PlayerInfo.cc	2011-04-06 14:39:29 UTC (rev 8196)
@@ -223,7 +223,7 @@
             return;
 
         this->controllableEntity_->setController(0);
-        
+
         this->controllableEntity_ = this->oldControllableEntity_;
         this->controllableEntityID_ = this->controllableEntity_->getObjectID();
         this->oldControllableEntity_ = 0;




More information about the Orxonox-commit mailing list