[Bug 127531] kreversi does not update score on undo

Inge Wallin inge at lysator.liu.se
Mon Jul 3 13:42:07 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         
inge lysator liu se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



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

Fix bug 127531: kreversi does not update score on undo.

- Keep track of score when removing a move too.

BUG: 127531



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


--- branches/KDE/3.5/kdegames/kreversi/ChangeLog #557534:557535
 @ -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
--- branches/KDE/3.5/kdegames/kreversi/Position.cpp #557534:557535
 @ -314,11 +314,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;
 }
 
--- branches/KDE/3.5/kdegames/kreversi/qreversigameview.h #557534:557535
 @ -100,7 +100,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