eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/game game.h history.cpp history.h results...


From: eliot-dev
Subject: [Eliot-dev] eliot/game game.h history.cpp history.h results...
Date: Tue, 27 Dec 2005 00:06:23 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Branch:         
Changes by:     Antoine Fraboulet <address@hidden>      05/12/27 00:06:23

Modified files:
        game           : game.h history.cpp history.h results.cpp 

Log message:
        - off by one in History. corrected. all regression tests ok.
        
        Scenario: training_dict
        Scenario: training_bag
        Scenario: training_search
        Scenario: training_play
        Scenario: duplicate_2_ai
        Scenario: freegame_passing
        Scenario: freegame_change
        Scenario: freegame_3_ai
        
        Summary: Everything was OK.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/game.h.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/history.cpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/history.h.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/results.cpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: eliot/game/game.h
diff -u eliot/game/game.h:1.24 eliot/game/game.h:1.25
--- eliot/game/game.h:1.24      Mon Dec 26 22:58:58 2005
+++ eliot/game/game.h   Tue Dec 27 00:06:23 2005
@@ -133,7 +133,7 @@
      * Methods to access already played words.
      * The int parameter should be 0 <= int < getNTurns()
      */
-    const History& getHistory() { return m_history; }
+    const History& getHistory() const { return m_history; }
 
     /**
      * Methods to access players.
Index: eliot/game/history.cpp
diff -u eliot/game/history.cpp:1.6 eliot/game/history.cpp:1.7
--- eliot/game/history.cpp:1.6  Mon Dec 26 22:57:44 2005
+++ eliot/game/history.cpp      Tue Dec 27 00:06:23 2005
@@ -60,7 +60,7 @@
 
 int History::getSize() const
 {
-    return m_history.size();
+    return m_history.size() - 1;
 }
 
 
@@ -79,7 +79,7 @@
 const Turn& History::getPreviousTurn() const
 {
     int idx = m_history.size() - 2;
-    ASSERT(0 <= idx , "Wrong turn number");
+    ASSERT(0 <= idx , "No previous turn");
     return *(m_history[idx]);
 }
 
Index: eliot/game/history.h
diff -u eliot/game/history.h:1.6 eliot/game/history.h:1.7
--- eliot/game/history.h:1.6    Mon Dec 26 22:57:44 2005
+++ eliot/game/history.h        Tue Dec 27 00:06:23 2005
@@ -28,10 +28,9 @@
 #define _HISTORY_H
 
 #include <vector>
-
-class Turn;
-class PlayedRack;
-class Round;
+#include "pldrack.h"
+#include "round.h"
+#include "turn.h"
 
 /**
  * History stores all the turns that have been played
@@ -39,9 +38,11 @@
  *  - one for the complete game
  *  - one for each of the players
  *
- * A History is never empty (getSize() can be used as the is the current turn
+ * A History is never void (getSize() can be used as the is the current turn
  * number for the complete game history). 
  *
+ * History starts at zero.
+ *
  * The top of the history is an empty
  * Turn until it has been filled and game is up to a new round.
  * 
Index: eliot/game/results.cpp
diff -u eliot/game/results.cpp:1.8 eliot/game/results.cpp:1.9
--- eliot/game/results.cpp:1.8  Mon Dec 26 21:22:21 2005
+++ eliot/game/results.cpp      Tue Dec 27 00:06:23 2005
@@ -58,8 +58,7 @@
 {
     clear();
 
-    /* we start at round 1 */
-    if (iTurn == 1)
+    if (iTurn == 0)
     {
         iBoard.searchFirst(iDic, iRack, *this);
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]