QTfrontend/statsPage.cpp
changeset 3381 f8800c44b3de
parent 3236 4ab3917d7d44
child 3788 9aa8a832e296
--- a/QTfrontend/statsPage.cpp	Thu Apr 29 19:40:13 2010 +0000
+++ b/QTfrontend/statsPage.cpp	Thu Apr 29 21:25:51 2010 +0000
@@ -21,6 +21,7 @@
 #include <QGraphicsScene>
 
 #include "statsPage.h"
+#include "team.h"
 
 FitGraphicsView::FitGraphicsView(QWidget* parent) : QGraphicsView(parent)
 {
@@ -123,5 +124,18 @@
             healthPoints[clan].append(hp);
             break;
         }
+        case 'T': { // local team stats
+            //AddStatText("<p>local team: " + info + "</p>");
+            QStringList infol = info.split(":");
+            HWTeam team(infol[0]);
+            if(team.FileExists()) // do some better test to avoid influence from scripted/predefined teams?
+            {
+                team.LoadFromFile();
+                team.Rounds++;
+                if(infol[1].toInt() > 0) // might require some better test for winning condition (or changed flag) ... WIP!
+                    team.Wins++; // should draws count as wins?
+                //team.SaveToFile(); // don't save yet
+            }
+        }
     }
 }