eliot-dev
[Top][All Lists]
Advanced

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

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


From: eliot-dev
Subject: [Eliot-dev] eliot/game board_search.cpp results.h results.cpp
Date: Mon, 26 Dec 2005 21:22:21 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Branch:         
Changes by:     Antoine Fraboulet <address@hidden>      05/12/26 21:22:21

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

Log message:
        - since we use History, the first round is numbered 1
        - separate sort_by_points method, removed call from board_search

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/board_search.cpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/results.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.7&tr2=1.8&r1=text&r2=text

Patches:
Index: eliot/game/board_search.cpp
diff -u eliot/game/board_search.cpp:1.8 eliot/game/board_search.cpp:1.9
--- eliot/game/board_search.cpp:1.8     Sat Dec 24 18:42:44 2005
+++ eliot/game/board_search.cpp Mon Dec 26 21:22:21 2005
@@ -269,7 +269,6 @@
     BoardSearchAux(*this, iDic, m_tilesCol, m_crossCol,
                    m_pointCol, m_jokerCol,
                    copyRack, oResults, Coord::VERTICAL);
-    oResults.sort();
 }
 
 
@@ -290,5 +289,4 @@
              m_pointRow, m_jokerRow,
              copyRack, partialword, oResults, Dic_root(iDic), row, col,
              copyRack.nTiles() - 1);
-    oResults.sort();
 }
Index: eliot/game/results.cpp
diff -u eliot/game/results.cpp:1.7 eliot/game/results.cpp:1.8
--- eliot/game/results.cpp:1.7  Sat Nov  5 15:48:59 2005
+++ eliot/game/results.cpp      Mon Dec 26 21:22:21 2005
@@ -18,6 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *****************************************************************************/
 
+/**
+ *  \file   results.cc
+ *  \brief  Search result storage class
+ *  \author Olivier Teulière & Antoine Fraboulet
+ *  \date   2005
+ */
+
 #include <algorithm>
 #include <functional>
 
@@ -51,17 +58,31 @@
 {
     clear();
 
-    if (iTurn == 0)
+    /* we start at round 1 */
+    if (iTurn == 1)
+    {
         iBoard.searchFirst(iDic, iRack, *this);
+    }
     else
+    {
         iBoard.search(iDic, iRack, *this);
+    }
+
+    sort_by_points();
 }
 
 
-void Results::sort()
+void Results::sort_by_points()
 {
     less_points lp;
     std::sort(m_rounds.begin(), m_rounds.end(), lp);
 }
 
+/****************************************************************/
+/****************************************************************/
 
+/// Local Variables:
+/// mode: c++
+/// mode: hs-minor
+/// c-basic-offset: 4
+/// End:
Index: eliot/game/results.h
diff -u eliot/game/results.h:1.6 eliot/game/results.h:1.7
--- eliot/game/results.h:1.6    Fri Nov  4 20:00:06 2005
+++ eliot/game/results.h        Mon Dec 26 21:22:21 2005
@@ -18,6 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *****************************************************************************/
 
+/**
+ *  \file   results.h
+ *  \brief  Search result storage class
+ *  \author Olivier Teulière & Antoine Fraboulet
+ *  \date   2005
+ */
+
 #ifndef _RESULTS_H_
 #define _RESULTS_H_
 
@@ -53,11 +60,20 @@
 
     // FIXME: These methods are used to fill the container with the rounds,
     // but they should not be part of the public interface
-    void sort();
     void add(const Round &iRound)   { m_rounds.push_back(iRound); }
 
+    void sort_by_points();
 private:
     vector<Round> m_rounds;
 };
 
 #endif
+
+/****************************************************************/
+/****************************************************************/
+
+/// Local Variables:
+/// mode: c++
+/// mode: hs-minor
+/// c-basic-offset: 4
+/// End:




reply via email to

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