[Orxonox-commit 129] r2821 - branches/miniprojects/src/orxonox/objects/gametypes

landauf at orxonox.net landauf at orxonox.net
Mon Mar 23 01:04:53 CET 2009


Author: landauf
Date: 2009-03-23 00:04:52 +0000 (Mon, 23 Mar 2009)
New Revision: 2821

Added:
   branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.cc
   branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.h
Removed:
   branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.cc
   branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.h
Modified:
   branches/miniprojects/src/orxonox/objects/gametypes/CMakeLists.txt
Log:
renamed TeamGametype to TeamDeathmatch.

Modified: branches/miniprojects/src/orxonox/objects/gametypes/CMakeLists.txt
===================================================================
--- branches/miniprojects/src/orxonox/objects/gametypes/CMakeLists.txt	2009-03-22 23:44:10 UTC (rev 2820)
+++ branches/miniprojects/src/orxonox/objects/gametypes/CMakeLists.txt	2009-03-23 00:04:52 UTC (rev 2821)
@@ -1,5 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Gametype.cc
   Deathmatch.cc
-  TeamGametype.cc
+  TeamDeathmatch.cc
 )

Copied: branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.cc (from rev 2820, branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.cc)
===================================================================
--- branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.cc	                        (rev 0)
+++ branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.cc	2009-03-23 00:04:52 UTC (rev 2821)
@@ -0,0 +1,191 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "TeamDeathmatch.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "objects/Teamcolourable.h"
+#include "objects/worldentities/TeamSpawnPoint.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamDeathmatch);
+
+    TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : Deathmatch(creator)
+    {
+        RegisterObject(TeamDeathmatch);
+
+        this->teams_ = 2;
+
+        this->setConfigValues();
+    }
+
+    void TeamDeathmatch::setConfigValues()
+    {
+        SetConfigValue(teams_, 2);
+
+        static ColourValue colours[] =
+        {
+            ColourValue(1.0, 0.3, 0.3),
+            ColourValue(0.3, 0.3, 1.0),
+            ColourValue(0.3, 1.0, 0.3),
+            ColourValue(1.0, 1.0, 0.0)
+        };
+        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+        SetConfigValueVector(teamcolours_, defaultcolours);
+    }
+
+    void TeamDeathmatch::playerEntered(PlayerInfo* player)
+    {
+        Deathmatch::playerEntered(player);
+
+        std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            if (it->second < this->teams_ && it->second >= 0)
+                playersperteam[it->second]++;
+
+        unsigned int minplayers = (unsigned int)-1;
+        size_t minplayersteam = 0;
+        for (size_t i = 0; i < this->teams_; ++i)
+        {
+            if (playersperteam[i] < minplayers)
+            {
+                minplayers = playersperteam[i];
+                minplayersteam = i;
+            }
+        }
+
+        this->teamnumbers_[player] = minplayersteam;
+    }
+
+    bool TeamDeathmatch::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Deathmatch::playerLeft(player);
+
+        if (valid_player)
+            this->players_.erase(player);
+
+        return valid_player;
+    }
+
+    bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    SpawnPoint* TeamDeathmatch::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        int desiredTeamNr = -1;
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            desiredTeamNr = it_player->second;
+
+        // Only use spawnpoints of the own team (or non-team-spawnpoints)
+        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+        for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        {
+            if ((*it)->isA(Class(TeamSpawnPoint)))
+            {
+                TeamSpawnPoint* tsp = dynamic_cast<TeamSpawnPoint*>(*it);
+                if (tsp && tsp->getTeamNumber() != desiredTeamNr)
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+            }
+
+            ++it;
+        }
+
+        if (teamSpawnPoints.size() > 0)
+        {
+            unsigned int randomspawn = (unsigned int)rnd(teamSpawnPoints.size());
+            unsigned int index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+        }
+
+        return 0;
+    }
+
+    void TeamDeathmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+        if (!player)
+            return;
+
+        // Set the team colour
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < this->teamcolours_.size())
+        {
+            if (pawn)
+            {
+                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+                {
+                    if ((*it)->isA(Class(Teamcolourable)))
+                    {
+                        Teamcolourable* tc = dynamic_cast<Teamcolourable*>(*it);
+                        tc->setTeamColour(this->teamcolours_[it_player->second]);
+                    }
+                }
+            }
+        }
+    }
+
+    bool TeamDeathmatch::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+    {
+        if (pawn1 && pawn2)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+                return (it1->second == it2->second);
+        }
+        return false;
+    }
+}


Property changes on: branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.cc
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/orxonox/objects/gametypes/TeamGametype.cc:1875-2277,2279-2401
/branches/buildsystem2/src/orxonox/objects/gametypes/TeamGametype.cc:2507-2659
/branches/buildsystem3/src/orxonox/objects/gametypes/TeamGametype.cc:2663-2709
/branches/ceguilua/src/orxonox/objects/gametypes/TeamGametype.cc:1803-1809
/branches/core3/src/orxonox/objects/gametypes/TeamGametype.cc:1573-1740
/branches/gcc43/src/orxonox/objects/gametypes/TeamGametype.cc:1581
/branches/gui/src/orxonox/objects/gametypes/TeamGametype.cc:1636-1724
/branches/input/src/orxonox/objects/gametypes/TeamGametype.cc:1630-1637
/branches/lodfinal/src/orxonox/objects/gametypes/TeamGametype.cc:2373-2412
/branches/network/src/orxonox/objects/gametypes/TeamGametype.cc:2357
/branches/network64/src/orxonox/objects/gametypes/TeamGametype.cc:2211-2356
/branches/objecthierarchy/src/orxonox/objects/gametypes/TeamGametype.cc:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/orxonox/objects/gametypes/TeamGametype.cc:2172-2480
/branches/overlay/src/orxonox/objects/gametypes/TeamGametype.cc:2118-2386
/branches/physics/src/orxonox/objects/gametypes/TeamGametype.cc:1913-2056,2108-2440
/branches/physics_merge/src/orxonox/objects/gametypes/TeamGametype.cc:2437-2458
/branches/pickups/src/orxonox/objects/gametypes/TeamGametype.cc:1927-2087,2128
/branches/pickups2/src/orxonox/objects/gametypes/TeamGametype.cc:2108-2498
/branches/presentation/src/orxonox/objects/gametypes/TeamGametype.cc:2370-2653,2655-2661
/branches/questsystem/src/orxonox/objects/gametypes/TeamGametype.cc:1895-2089
/branches/questsystem2/src/orxonox/objects/gametypes/TeamGametype.cc:2108-2260
/branches/script_trigger/src/orxonox/objects/gametypes/TeamGametype.cc:1296-1954,1956
/branches/weapon/src/orxonox/objects/gametypes/TeamGametype.cc:1926-2095
/branches/weapon2/src/orxonox/objects/gametypes/TeamGametype.cc:2108-2489

Copied: branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.h (from rev 2820, branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.h)
===================================================================
--- branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.h	                        (rev 0)
+++ branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.h	2009-03-23 00:04:52 UTC (rev 2821)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamDeathmatch_H__
+#define _TeamDeathmatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+
+#include "Deathmatch.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamDeathmatch : public Deathmatch
+    {
+        public:
+            TeamDeathmatch(BaseObject* creator);
+            virtual ~TeamDeathmatch() {}
+
+            void setConfigValues();
+
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+            std::map<PlayerInfo*, int> teamnumbers_;
+            std::vector<ColourValue> teamcolours_;
+            unsigned int teams_;
+    };
+}
+
+#endif /* _TeamDeathmatch_H__ */


Property changes on: branches/miniprojects/src/orxonox/objects/gametypes/TeamDeathmatch.h
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/orxonox/objects/gametypes/TeamGametype.h:1875-2277,2279-2401
/branches/buildsystem2/src/orxonox/objects/gametypes/TeamGametype.h:2507-2659
/branches/buildsystem3/src/orxonox/objects/gametypes/TeamGametype.h:2663-2709
/branches/ceguilua/src/orxonox/objects/gametypes/TeamGametype.h:1803-1809
/branches/core3/src/orxonox/objects/gametypes/TeamGametype.h:1573-1740
/branches/gcc43/src/orxonox/objects/gametypes/TeamGametype.h:1581
/branches/gui/src/orxonox/objects/gametypes/TeamGametype.h:1636-1724
/branches/input/src/orxonox/objects/gametypes/TeamGametype.h:1630-1637
/branches/lodfinal/src/orxonox/objects/gametypes/TeamGametype.h:2373-2412
/branches/network/src/orxonox/objects/gametypes/TeamGametype.h:2357
/branches/network64/src/orxonox/objects/gametypes/TeamGametype.h:2211-2356
/branches/objecthierarchy/src/orxonox/objects/gametypes/TeamGametype.h:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/orxonox/objects/gametypes/TeamGametype.h:2172-2480
/branches/overlay/src/orxonox/objects/gametypes/TeamGametype.h:2118-2386
/branches/physics/src/orxonox/objects/gametypes/TeamGametype.h:1913-2056,2108-2440
/branches/physics_merge/src/orxonox/objects/gametypes/TeamGametype.h:2437-2458
/branches/pickups/src/orxonox/objects/gametypes/TeamGametype.h:1927-2087,2128
/branches/pickups2/src/orxonox/objects/gametypes/TeamGametype.h:2108-2498
/branches/presentation/src/orxonox/objects/gametypes/TeamGametype.h:2370-2653,2655-2661
/branches/questsystem/src/orxonox/objects/gametypes/TeamGametype.h:1895-2089
/branches/questsystem2/src/orxonox/objects/gametypes/TeamGametype.h:2108-2260
/branches/script_trigger/src/orxonox/objects/gametypes/TeamGametype.h:1296-1954,1956
/branches/weapon/src/orxonox/objects/gametypes/TeamGametype.h:1926-2095
/branches/weapon2/src/orxonox/objects/gametypes/TeamGametype.h:2108-2489

Deleted: branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.cc
===================================================================
--- branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.cc	2009-03-22 23:44:10 UTC (rev 2820)
+++ branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.cc	2009-03-23 00:04:52 UTC (rev 2821)
@@ -1,191 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "TeamGametype.h"
-
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "objects/Teamcolourable.h"
-#include "objects/worldentities/TeamSpawnPoint.h"
-
-namespace orxonox
-{
-    CreateUnloadableFactory(TeamGametype);
-
-    TeamGametype::TeamGametype(BaseObject* creator) : Deathmatch(creator)
-    {
-        RegisterObject(TeamGametype);
-
-        this->teams_ = 2;
-
-        this->setConfigValues();
-    }
-
-    void TeamGametype::setConfigValues()
-    {
-        SetConfigValue(teams_, 2);
-
-        static ColourValue colours[] =
-        {
-            ColourValue(1.0, 0.3, 0.3),
-            ColourValue(0.3, 0.3, 1.0),
-            ColourValue(0.3, 1.0, 0.3),
-            ColourValue(1.0, 1.0, 0.0)
-        };
-        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
-
-        SetConfigValueVector(teamcolours_, defaultcolours);
-    }
-
-    void TeamGametype::playerEntered(PlayerInfo* player)
-    {
-        Deathmatch::playerEntered(player);
-
-        std::vector<unsigned int> playersperteam(this->teams_, 0);
-
-        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
-            if (it->second < this->teams_ && it->second >= 0)
-                playersperteam[it->second]++;
-
-        unsigned int minplayers = (unsigned int)-1;
-        size_t minplayersteam = 0;
-        for (size_t i = 0; i < this->teams_; ++i)
-        {
-            if (playersperteam[i] < minplayers)
-            {
-                minplayers = playersperteam[i];
-                minplayersteam = i;
-            }
-        }
-
-        this->teamnumbers_[player] = minplayersteam;
-    }
-
-    bool TeamGametype::playerLeft(PlayerInfo* player)
-    {
-        bool valid_player = Deathmatch::playerLeft(player);
-
-        if (valid_player)
-            this->players_.erase(player);
-
-        return valid_player;
-    }
-
-    bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
-    {
-        return (!this->pawnsAreInTheSameTeam(victim, originator));
-    }
-
-    bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
-    {
-        return (!this->pawnsAreInTheSameTeam(victim, originator));
-    }
-
-    bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
-    {
-        return (!this->pawnsAreInTheSameTeam(victim, originator));
-    }
-
-    SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
-    {
-        int desiredTeamNr = -1;
-        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
-        if (it_player != this->teamnumbers_.end())
-            desiredTeamNr = it_player->second;
-
-        // Only use spawnpoints of the own team (or non-team-spawnpoints)
-        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
-        for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
-        {
-            if ((*it)->isA(Class(TeamSpawnPoint)))
-            {
-                TeamSpawnPoint* tsp = dynamic_cast<TeamSpawnPoint*>(*it);
-                if (tsp && tsp->getTeamNumber() != desiredTeamNr)
-                {
-                    teamSpawnPoints.erase(it++);
-                    continue;
-                }
-            }
-
-            ++it;
-        }
-
-        if (teamSpawnPoints.size() > 0)
-        {
-            unsigned int randomspawn = (unsigned int)rnd(teamSpawnPoints.size());
-            unsigned int index = 0;
-            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
-            {
-                if (index == randomspawn)
-                    return (*it);
-
-                ++index;
-            }
-        }
-
-        return 0;
-    }
-
-    void TeamGametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
-    {
-        if (!player)
-            return;
-
-        // Set the team colour
-        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
-        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < this->teamcolours_.size())
-        {
-            if (pawn)
-            {
-                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
-                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
-                {
-                    if ((*it)->isA(Class(Teamcolourable)))
-                    {
-                        Teamcolourable* tc = dynamic_cast<Teamcolourable*>(*it);
-                        tc->setTeamColour(this->teamcolours_[it_player->second]);
-                    }
-                }
-            }
-        }
-    }
-
-    bool TeamGametype::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
-    {
-        if (pawn1 && pawn2)
-        {
-            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
-            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
-
-            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
-                return (it1->second == it2->second);
-        }
-        return false;
-    }
-}

Deleted: branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.h
===================================================================
--- branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.h	2009-03-22 23:44:10 UTC (rev 2820)
+++ branches/miniprojects/src/orxonox/objects/gametypes/TeamGametype.h	2009-03-23 00:04:52 UTC (rev 2821)
@@ -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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _TeamGametype_H__
-#define _TeamGametype_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <vector>
-
-#include "Deathmatch.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport TeamGametype : public Deathmatch
-    {
-        public:
-            TeamGametype(BaseObject* creator);
-            virtual ~TeamGametype() {}
-
-            void setConfigValues();
-
-            virtual void playerEntered(PlayerInfo* player);
-            virtual bool playerLeft(PlayerInfo* player);
-
-            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
-            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
-            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
-
-            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
-
-        protected:
-            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
-            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
-
-            std::map<PlayerInfo*, int> teamnumbers_;
-            std::vector<ColourValue> teamcolours_;
-            unsigned int teams_;
-    };
-}
-
-#endif /* _TeamGametype_H__ */




More information about the Orxonox-commit mailing list