[Bug 127531] kreversi does not update score on undo

Inge Wallin inge at lysator.liu.se
Mon Jul 3 13:58:36 UTC 2006


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=127531         




------- Additional Comments From inge lysator liu se  2006-07-03 15:58 -------
SVN commit 557545 by ingwa:

Fix bug 127531: kreversi does not update score on undo

 - Keep track of score when removing a move too.

CCBUG: 127531


 M  +8 -0      ChangeLog  
 M  +4 -0      Position.cpp  
 M  +4 -1      qreversigameview.h  


--- trunk/KDE/kdegames/kreversi/ChangeLog #557544:557545
 @ -1,3 +1,11  @
+2006-07-03  Inge Wallin  <inge lysator liu se>
+
+	* Position.cpp (undoMove): Keep track of score when undoing a
+	move.
+
+	* qreversigameview.h (removeMove): show game status after removing
+	a move.
+	
 2006-07-02  Inge Wallin  <inge lysator liu se>
 
 	* qreversigameview.cpp (moveMade): Print color Red/Blue in
--- trunk/KDE/kdegames/kreversi/Position.cpp #557544:557545
 @ -316,11 +316,15  @
     int  sq = *it;
 
     m_board[sq / 10][sq % 10] = other;
+    m_score.dec(color);
+    m_score.inc(other);
   }
 
   // 2. Remove the move itself.
+  m_score.dec(color);
   m_board[move.x()][move.y()] = Nobody;
 
+
   return true;
 }
 
--- trunk/KDE/kdegames/kreversi/qreversigameview.h #557544:557545
 @ -103,7 +103,10  @
   // Proxy methods for the movelist
   // FIXME: Not all of these need to be externally reachable
   void insertMove(QString moveString) { m_movesView->insertItem(moveString); }
-  void removeMove(int moveNum) { m_movesView->removeItem(moveNum); }
+  void removeMove(int moveNum) { 
+    m_movesView->removeItem(moveNum); 
+    updateStatus();
+  }
   void setCurrentMove(int moveNum) { 
     m_movesView->setCurrentItem(moveNum); 
     m_movesView->ensureCurrentVisible();



More information about the pkg-kde-bugs-fwd mailing list