QTfrontend/hedgehogerWidget.cpp
changeset 1300 22c03f69e142
parent 1066 1f1b3686a2b0
child 1784 dfe9bafb4590
--- a/QTfrontend/hedgehogerWidget.cpp	Mon Sep 29 21:59:19 2008 +0000
+++ b/QTfrontend/hedgehogerWidget.cpp	Mon Sep 29 22:01:06 2008 +0000
@@ -24,17 +24,17 @@
     ItemNum(im, parent, 1)
 {
   if(parent) {
-    pOurFrameTeams=dynamic_cast<FrameTeams*>(parent->parentWidget());
+    pOurFrameTeams = dynamic_cast<FrameTeams*>(parent->parentWidget());
   }
-  if(pOurFrameTeams->overallHedgehogs+4>pOurFrameTeams->maxHedgehogsPerGame) {
-    numItems=pOurFrameTeams->maxHedgehogsPerGame-pOurFrameTeams->overallHedgehogs;
-  } else numItems=4;
-  pOurFrameTeams->overallHedgehogs+=numItems;
+  if(pOurFrameTeams->overallHedgehogs + 4 > pOurFrameTeams->maxHedgehogsPerGame) {
+    numItems = pOurFrameTeams->maxHedgehogsPerGame - pOurFrameTeams->overallHedgehogs;
+  } else numItems = 4;
+  pOurFrameTeams->overallHedgehogs += numItems;
 }
 
-void CHedgehogerWidget::incItems() 
+void CHedgehogerWidget::incItems()
 {
-  if (pOurFrameTeams->overallHedgehogs<18) {
+  if (pOurFrameTeams->overallHedgehogs < 18) {
     numItems++;
     pOurFrameTeams->overallHedgehogs++;
     emit hedgehogsNumChanged();
@@ -60,9 +60,9 @@
 
 void CHedgehogerWidget::setHHNum(unsigned int num)
 {
-  unsigned int diff=numItems-num;
-  numItems=num;
-  pOurFrameTeams->overallHedgehogs+=diff;
+  unsigned int diff = num - numItems;
+  numItems += diff;
+  pOurFrameTeams->overallHedgehogs += diff;
   repaint();
 }