Index: code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.cc
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.cc	(revision 2902)
+++ code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.cc	(revision 2902)
@@ -0,0 +1,185 @@
+/*
+ *   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:
+ */
+ 
+ 
+
+#include TeamBaseMatch.h
+
+
+//implement this! not done yet!
+#include "objects/worldentities/pawns/TeamBaseMatchBase.h" 
+ 
+ 
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamBaseMatch);
+
+
+    // Timer and Creator
+    TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathMatch(creator)
+    {
+        RegisterObject(TeamBaseMatch);
+
+        this->scoreTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::winPoints)));
+        this->outputTimer_.setTimer(30, true, this, createExecutor(createFunctor(&TeamBaseMatch::showPoints)));
+
+        this->pointsTeam1_ = 0;
+        this->pointsTeam2_ = 0;
+    }
+     
+    
+    // set the Bases positions using XML
+    void TeamBaseMatch::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+//        XMLPortObject(TeamBaseMatch, WorldEntity, setNeutralshape, getNeturalshape, xmlelement, mode); 
+//        XMLPortObject(TeamBaseMatch, WorldEntity, setTeam1shape, getTeam1shape, xmlelement, mode);
+//        XMLPortObject(TeamBaseMatch, WorldEntity, setTeam2shape, getTeam2shape, xmlelement, mode);
+
+        XMLPortObject(TeamBaseMatch, TeamBaseMatchBase, addBase, getBase, xmlelement, mode);
+    }
+    
+    // pretty useless at the moment...should be implemented in the TeamBaseMatchBase class headerfile
+    // State of the Base (controlled, uncontrolled)
+    int TeamBaseMatch::baseState(Base)
+    {
+        if(Enum state_==uncontrolled) return 0;
+        if(Enum state_==controlTeam1) return 1;
+        if(Enum state_==controlTeam2) return 2;
+    }
+    
+    bool TeamBaseMatch::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        set::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(victim);
+        if (it != this->bases_.end() && victim)
+        {
+            TeamBaseMatchBase* base = dynamic_cast<TeamBaseMatchBase*>(victim);
+            if (base)
+            {
+                int teamnr = this->getTeam(originator->getPlayer());
+                if (teamnr == 0)
+                    base->setState(BaseState::controlTeam1);
+                if (teamnr == 1)
+                    base->setState(BaseState::controlTeam2);
+            }
+
+            victim->setHealth(victim->getInitialHealth());
+            return false;
+        }
+
+        return TeamDeathmatch::allowPawnDeath(victim, originator);
+    }
+
+    // collect Points for killing oppenents
+    void TeamBaseMatch::playerScored(PlayerInfo* player)
+    {
+        int teamnr = this->getTeam(player);
+        this->addTeamPoints(teamnr, 5);
+    }
+
+    // show points or each interval of time
+    void TeamBaseMatch::showPoints()
+    {
+	
+	COUT(0) << "Points standing:" << std::endl << "Team 1: "<< pointsTeam1_ << std::endl << "Team 2: " << pointsTeam2_ << std::endl;
+	if(pointsTeam1_ >=1700) COUT(0) << "Team 1 is near victory!" << std::endl;
+	if(pointsTeam2_ >=1700) COUT(0) << "Team 2 is near victory!" << std::endl;
+    }
+
+
+    // collect Points while controlling Bases
+    void TeamBaseMatch::winPoints()
+    {
+	int amountControlled = 0;
+	int amountControlled2 = 0;
+
+        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
+        {
+	    if((*it)->getState() == BaseState::controlTeam1)
+	    {
+	        amountControlled++;
+	    }
+	    if((*it)->getState() == BaseState::controlTeam2)
+	    {
+		amountControlled2++;
+	    }
+        }
+
+        this->addTeamPoints(0, (amountControlled * 30));
+        this->addTeamPoints(1, (amountControlled2 * 30));
+    }
+
+
+    // end game if one team reaches 2000 points
+    void TeamBaseMatch::endGame()
+    {
+        if(this->pointsTeam1_>=2000 || this->pointsTeam2_ >=2000)
+        {
+            this->end();
+        }
+    }
+
+    void addTeamPoints(int team, int points)
+    {
+        if(player && teamnr == 0)
+        {
+            this->pointsTeam1_ += points;
+        }
+        if(player && teamnr == 1)
+        {
+            this->pointsTeam2_ += points;
+        }      
+
+        this->endGame();
+    }
+
+    void TeamBaseMatch::addBase(TeamBaseMatchBase* base)
+    {
+        this->bases_.insert(base);
+        base->setState(BaseState::uncontrolled);
+    }
+
+    TeamBaseMatchBase* TeamBaseMatch::getBase(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
+        {
+            i++;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+
+    // declare the functions 'getshape' and 'setshape' from the XML function here
+ 
+
+
+
+    
+}
+
+ 
+
+ 
Index: code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.h
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.h	(revision 2902)
+++ code/trunk/src/orxonox/objects/gametypes/TeamBaseMatch.h	(revision 2902)
@@ -0,0 +1,89 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamBaseMatch_H__
+#define _TeamBaseMatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include <set>
+
+#include "TeamDeathmatch.h"
+#include "util/Timer.h"
+
+
+
+namespace orxonox
+{
+ 
+
+
+    class _OrxonoxExport TeamBaseMatch : public TeamDeathmatch
+    {
+        public:
+            TeamBasematch(BaseObject* creator);
+            
+            // if class closes, close everything           
+            virtual ~TeamBaseMatch() {}
+            
+            
+            // set Base positions with XML 
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+                        
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            // give information about the state of a base 
+            virtual int baseState(Base);
+            
+	    virtual void playerScored(PlayerInfo* player);
+            virtual void showPoints();
+            virtual void endGame();
+            
+            void addBase(TeamBaseMatchBase* base);
+            TeamBaseMatchBase* getBase(unsigned int index) const;
+
+            void addTeamPoints(int team, int points);
+            
+            
+            
+            
+        protected:
+            void winPoints();
+
+            std::set<TeamBaseMatchBase*> bases_;
+            Timer<TeamBaseMatch> scoreTimer_;
+            Timer<TeamBaseMatch> outputTimer_;
+            
+            //points for each team
+            int pointsTeam1_;
+            int pointsTeam2_;
+    };
+}
+
+#endif /* _TeamBaseMatch_H__ */
Index: code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc	(revision 2896)
+++ code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.cc	(revision 2902)
@@ -189,3 +189,12 @@
         return false;
     }
+
+    int TeamDeathmatch::getTeam(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            return it_player->second;
+        else
+            return -1;
+    }
 }
Index: code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.h
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.h	(revision 2896)
+++ code/trunk/src/orxonox/objects/gametypes/TeamDeathmatch.h	(revision 2902)
@@ -58,4 +58,5 @@
             virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
             bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+            int getTeam(PlayerInfo* player);
 
             std::map<PlayerInfo*, int> teamnumbers_;
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2896)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2902)
@@ -198,4 +198,5 @@
     void Pawn::death()
     {
+        this->setHealth(1);
         if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
         {
@@ -214,6 +215,4 @@
                 this->deatheffect();
         }
-        else
-            this->setHealth(1);
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h	(revision 2902)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h	(revision 2902)
@@ -0,0 +1,95 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+
+// setState und getState functions declare here
+// TeamBaseMatchBase class 
+
+
+// save as TeamBaseMatchBase.h in objects/worldentities/pawns/TeamBaseMatchBase.h
+
+
+#ifndef _TeamBaseMatchBase_H__
+#define _TeamBaseMatchBase_H__
+
+#include "pawn.h"
+
+namespace orxonox
+{
+
+
+    namespace BaseState
+    {
+        enum Enum
+        {
+            uncontrolled,
+            controlTeam1,
+            controlTeam2,
+        };
+    }
+
+    struct Base
+    {
+        BaseState::Enum state_;
+    };
+
+
+
+
+
+
+    class _OrxonoxExport TeamBaseMatchBase : public RadarViewable
+    {
+        public:
+            TeamBaseMatchBase(BaseObject* creator);
+
+	    // if class closes, close everything  
+            virtual ~TeamBaseMatchBase();
+	    
+	    virtual void setState(base)
+	    {
+		
+
+	    }
+	    virtual enum getState(base);
+
+    	    
+
+
+
+	protected:
+
+
+
+
+
+ 
+}
+
+#endif /* _TeamBaseMatchBase_H__ */
