Index: code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc	(revision 2494)
+++ code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc	(revision 2495)
@@ -35,6 +35,7 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Loader.h"
-#include "core/XMLFile.h"
+#include "core/Template.h"
+#include "core/Core.h"
+#include "overlays/OverlayGroup.h"
 #include "objects/infos/PlayerInfo.h"
 #include "objects/infos/Bot.h"
@@ -68,12 +69,15 @@
         this->addBots(this->numberOfBots_);
 
-        this->statsOverlay_ = 0;
-
         setConfigValues();
 
         // load the corresponding score board
-        //this->statsOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/" + this->statsOverlayName_);
-        //Loader::open(statsOverlay_);
-        //this->setGametype(this);
+        if (Core::showsGraphics() && this->scoreboardTemplate_ != "")
+        {
+            this->scoreboard_ = new OverlayGroup(this);
+            this->scoreboard_->addTemplate(this->scoreboardTemplate_);
+            this->scoreboard_->setGametype(this);
+        }
+        else
+            this->scoreboard_ = 0;
     }
 
@@ -84,5 +88,5 @@
         SetConfigValue(bForceSpawn_, false);
         SetConfigValue(numberOfBots_, 0);
-        SetConfigValue(statsOverlayName_, "stats.oxo");
+        SetConfigValue(scoreboardTemplate_, "defaultScoreboard");
     }
 
@@ -118,5 +122,5 @@
     void Gametype::playerEntered(PlayerInfo* player)
     {
-        this->players_[player] = PlayerState::Joined;
+        this->players_[player].state_ = PlayerState::Joined;
 
         std::string message = player->getName() + " entered the game";
@@ -127,5 +131,5 @@
     void Gametype::playerLeft(PlayerInfo* player)
     {
-        std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(player);
+        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
         if (it != this->players_.end())
         {
@@ -188,8 +192,21 @@
         if (victim && victim->getPlayer())
         {
-            std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(victim->getPlayer());
+            std::map<PlayerInfo*, Player>::iterator it = this->players_.find(victim->getPlayer());
             if (it != this->players_.end())
             {
-                it->second = PlayerState::Dead;
+                it->second.state_ = PlayerState::Dead;
+                it->second.killed_++;
+
+                // Reward killer
+                if (killer)
+                {
+                    std::map<PlayerInfo*, Player>::iterator itKiller = this->players_.find(killer->getPlayer());
+                    if (itKiller != this->players_.end())
+                    {
+                        this->playerScored(itKiller->second);
+                    }
+                    else
+                        COUT(2) << "Warning: Killing Pawn was not in the playerlist" << std::endl;
+                }
 
                 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
@@ -211,6 +228,7 @@
     }
 
-    void Gametype::playerScored(PlayerInfo* player)
-    {
+    void Gametype::playerScored(Player& player)
+    {
+        player.frags_++;
     }
 
@@ -234,9 +252,9 @@
     void Gametype::assignDefaultPawnsIfNeeded()
     {
-        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
         {
             if (!it->first->getControllableEntity())
             {
-                it->second = PlayerState::Dead;
+                it->second.state_ = PlayerState::Dead;
 
                 if (!it->first->isReadyToSpawn() || !this->gtinfo_.bStarted_)
@@ -249,5 +267,5 @@
                         spawn->spawn(entity);
                         it->first->startControl(entity);
-                        it->second = PlayerState::Dead;
+                        it->second.state_ = PlayerState::Dead;
                     }
                     else
@@ -284,5 +302,5 @@
                     bool allplayersready = true;
                     bool hashumanplayers = false;
-                    for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+                    for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
                     {
                         if (!it->first->isReadyToSpawn())
@@ -303,5 +321,5 @@
     void Gametype::spawnPlayersIfRequested()
     {
-        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
             if (it->first->isReadyToSpawn() || this->bForceSpawn_)
                 this->spawnPlayer(it->first);
@@ -310,6 +328,6 @@
     void Gametype::spawnDeadPlayersIfRequested()
     {
-        for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
-            if (it->second == PlayerState::Dead)
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->second.state_ == PlayerState::Dead)
                 if (it->first->isReadyToSpawn() || this->bForceSpawn_)
                     this->spawnPlayer(it->first);
@@ -322,5 +340,5 @@
         {
             player->startControl(spawnpoint->spawn());
-            this->players_[player] = PlayerState::Alive;
+            this->players_[player].state_ = PlayerState::Alive;
         }
         else
Index: code/branches/presentation/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- code/branches/presentation/src/orxonox/objects/gametypes/Gametype.h	(revision 2494)
+++ code/branches/presentation/src/orxonox/objects/gametypes/Gametype.h	(revision 2495)
@@ -53,8 +53,15 @@
     }
 
+    struct Player
+    {
+        PlayerInfo* info_;
+        PlayerState::Enum state_;
+        int frags_;
+        int killed_;
+    };
+
     class _OrxonoxExport Gametype : public BaseObject, public Tickable
     {
         friend class PlayerInfo;
-        friend class ClassIdentifier<Gametype>;
 
         public:
@@ -82,5 +89,5 @@
             virtual void playerChangedName(PlayerInfo* player);
 
-            virtual void playerScored(PlayerInfo* player);
+            virtual void playerScored(Player& player);
 
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
@@ -88,5 +95,5 @@
             virtual void pawnPostSpawn(Pawn* pawn);
 
-            inline const std::map<PlayerInfo*, PlayerState::Enum>& getPlayers() const
+            inline const std::map<PlayerInfo*, Player>& getPlayers() const
                 { return this->players_; }
 
@@ -104,10 +111,4 @@
             inline unsigned int getNumberOfPlayers() const
                 { return this->players_.size(); }
-
-            inline std::string getPlayersName() const
-                { return "StatsBot77"; }
-
-            inline unsigned int getPlayersFrags() const
-                { return 123; }
 
         private:
@@ -131,12 +132,12 @@
             unsigned int numberOfBots_;
 
-            std::map<PlayerInfo*, PlayerState::Enum> players_;
+            std::map<PlayerInfo*, Player> players_;
             std::set<SpawnPoint*> spawnpoints_;
             SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
 
-            XMLFile* statsOverlay_;
+            OverlayGroup* scoreboard_;
 
             // Config Values
-            std::string statsOverlayName_;
+            std::string scoreboardTemplate_;
     };
 }
