/[eliot]/eliot/game/results.cpp
ViewVC logotype

Diff of /eliot/game/results.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ipkiss, Sun Oct 23 14:53:43 2005 UTC revision 1.5.2.1 by afrab, Sun Oct 23 17:16:24 2005 UTC
# Line 30  Line 30 
30  #include "debug.h"  #include "debug.h"
31    
32    
33  struct less_points : public binary_function<const Round&,  struct less_points : public std::binary_function < const Round&, const Round&, bool >
                      const Round&, bool>  
34  {  {
35      bool operator()(const Round &r1, const Round &r2)      bool operator()(const Round &r1, const Round &r2)
36      {      {
# Line 43  struct less_points : public binary_funct Line 42  struct less_points : public binary_funct
42    
43  const Round & Results::get(int i) const  const Round & Results::get(int i) const
44  {  {
45      ASSERT(0 <= i && i < size(),      ASSERT(0 <= i && i < size(), "Results index out of bounds");
            "Results index out of bounds");  
46      return m_rounds[i];      return m_rounds[i];
47  }  }
48    
49    
50  void Results::search(const Dictionary &iDic, Board &iBoard,  void Results::search(const Dictionary iDic, Board &iBoard,
51                       const Rack &iRack, int iTurn)                       const Rack &iRack, int iTurn)
52  {  {
53      clear();      clear();
54    
55      if (iTurn == 0)      if (iTurn == 0)
56          {
57          iBoard.searchFirst(iDic, iRack, *this);          iBoard.searchFirst(iDic, iRack, *this);
58          }
59      else      else
60          {
61          iBoard.search(iDic, iRack, *this);          iBoard.search(iDic, iRack, *this);
62          }
63  }  }
64    
65    
66  void Results::sort()  void Results::sort_by_points()
67  {  {
68      less_points lp;      less_points lp;
69      std::sort(m_rounds.begin(), m_rounds.end(), lp);      std::sort(m_rounds.begin(), m_rounds.end(), lp);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.5.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26