eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] eliot dic/header.h game/bag.h game/board.cpp ga...


From: eliot-dev
Subject: [Eliot-dev] eliot dic/header.h game/bag.h game/board.cpp ga...
Date: Wed, 09 Jan 2008 10:48:20 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/01/09 10:48:20

Modified files:
        dic            : header.h 
        game           : bag.h board.cpp board.h board_search.cpp 
        utils          : game_io.cpp ncurses.cpp 
        wxwin          : gfxboard.cc 

Log message:
         - Board::GetLetterMultiplier() and Board::GetWordMultiplier() are now 
static
         - Added 2 convenient getters: Dictionary::getName() and Bag::getDic()

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/header.h?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/game/bag.h?cvsroot=eliot&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/eliot/game/board.cpp?cvsroot=eliot&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/eliot/game/board.h?cvsroot=eliot&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/eliot/game/board_search.cpp?cvsroot=eliot&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/eliot/utils/game_io.cpp?cvsroot=eliot&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/eliot/utils/ncurses.cpp?cvsroot=eliot&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/eliot/wxwin/gfxboard.cc?cvsroot=eliot&r1=1.10&r2=1.11

Patches:
Index: dic/header.h
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/header.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- dic/header.h        8 Jan 2008 13:52:35 -0000       1.2
+++ dic/header.h        9 Jan 2008 10:48:19 -0000       1.3
@@ -102,6 +102,7 @@
     unsigned int getNbEdgesUsed()  const { return m_edgesUsed; }
     unsigned int getNbNodesSaved() const { return m_nodesSaved; }
     unsigned int getNbEdgesSaved() const { return m_edgesSaved; }
+    wstring      getName()         const { return m_dicName; }
     DictType     getType()         const { return m_type; }
     wstring      getLetters()      const { return m_letters; }
     uint8_t      getPoints(unsigned int iCode) const { return m_points[iCode - 
1]; }

Index: game/bag.h
===================================================================
RCS file: /cvsroot/eliot/eliot/game/bag.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- game/bag.h  8 Jan 2008 13:52:37 -0000       1.10
+++ game/bag.h  9 Jan 2008 10:48:19 -0000       1.11
@@ -75,6 +75,9 @@
 
     void operator=(const Bag &iOther);
 
+    /// Convenience getter on the dictionary
+    const Dictionary & getDic() const { return m_dic; }
+
     /// Print on stderr all the letters of the bag (for debugging purposes)
     void dumpAll() const;
 

Index: game/board.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/board.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- game/board.cpp      8 Jan 2008 13:52:37 -0000       1.18
+++ game/board.cpp      9 Jan 2008 10:48:19 -0000       1.19
@@ -129,7 +129,7 @@
 }
 
 
-Tile Board::getTile(int iRow, int iCol) const
+const Tile& Board::getTile(int iRow, int iCol) const
 {
     return m_tilesRow[iRow][iCol];
 }
@@ -443,7 +443,7 @@
 }
 
 
-int Board::getWordMultiplier(int iRow, int iCol) const
+int Board::GetWordMultiplier(int iRow, int iCol)
 {
     if (iRow < BOARD_MIN || iRow > BOARD_MAX ||
         iCol < BOARD_MIN || iCol > BOARD_MAX)
@@ -452,7 +452,7 @@
 }
 
 
-int Board::getLetterMultiplier(int iRow, int iCol) const
+int Board::GetLetterMultiplier(int iRow, int iCol)
 {
     if (iRow < BOARD_MIN || iRow > BOARD_MAX ||
         iCol < BOARD_MIN || iCol > BOARD_MAX)

Index: game/board.h
===================================================================
RCS file: /cvsroot/eliot/eliot/game/board.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- game/board.h        8 Jan 2008 13:52:37 -0000       1.14
+++ game/board.h        9 Jan 2008 10:48:19 -0000       1.15
@@ -83,7 +83,7 @@
     wchar_t getChar    (int iRow, int iCol) const;
     int     getCharAttr(int iRow, int iCol) const;
 
-    Tile getTile(int iRow, int iCol) const;
+    const Tile& getTile(int iRow, int iCol) const;
     bool isJoker(int iRow, int iCol) const;
     bool isVacant(int iRow, int iCol) const;
 
@@ -112,8 +112,8 @@
     /**
      *
      */
-    int getWordMultiplier(int iRow, int iCol) const;
-    int getLetterMultiplier(int iRow, int iCol) const;
+    static int GetWordMultiplier(int iRow, int iCol);
+    static int GetLetterMultiplier(int iRow, int iCol);
 
     /**
      * 

Index: game/board_search.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/board_search.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- game/board_search.cpp       8 Jan 2008 13:52:37 -0000       1.15
+++ game/board_search.cpp       9 Jan 2008 10:48:19 -0000       1.16
@@ -61,15 +61,15 @@
             int l;
             if (!iWord.isJoker(i))
                 l = iWord.getTile(i).getPoints() *
-                    iBoard.getLetterMultiplier(row, col + i);
+                    iBoard.GetLetterMultiplier(row, col + i);
             else
                 l = 0;
             pts += l;
-            wordmul *= iBoard.getWordMultiplier(row, col + i);
+            wordmul *= iBoard.GetWordMultiplier(row, col + i);
 
             int t = iPointsMx[row][col+i];
             if (t >= 0)
-                ptscross += (t + l) * iBoard.getWordMultiplier(row, col + i);
+                ptscross += (t + l) * iBoard.GetWordMultiplier(row, col + i);
             fromrack++;
         }
     }

Index: utils/game_io.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/utils/game_io.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- utils/game_io.cpp   8 Jan 2008 13:52:42 -0000       1.12
+++ utils/game_io.cpp   9 Jan 2008 10:48:19 -0000       1.13
@@ -129,8 +129,8 @@
                 out << padAndConvert(wstring(1, l), 3);
             else
             {
-                int wm = iGame.getBoard().getWordMultiplier(row, col);
-                int tm = iGame.getBoard().getLetterMultiplier(row, col);
+                int wm = iGame.getBoard().GetWordMultiplier(row, col);
+                int tm = iGame.getBoard().GetLetterMultiplier(row, col);
 
                 if (wm > 1)
                     out << "  " << ((wm == 3) ? '@' : '#');
@@ -160,8 +160,8 @@
         for (col = BOARD_MIN; col <= BOARD_MAX; col++)
         {
             wchar_t l = iGame.getBoard().getChar(row, col);
-            int wm = iGame.getBoard().getWordMultiplier(row, col);
-            int tm = iGame.getBoard().getLetterMultiplier(row, col);
+            int wm = iGame.getBoard().GetWordMultiplier(row, col);
+            int tm = iGame.getBoard().GetLetterMultiplier(row, col);
 
             if (wm > 1)
                 out << " " << ((wm == 3) ? '@' : '#');

Index: utils/ncurses.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/utils/ncurses.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- utils/ncurses.cpp   8 Jan 2008 13:52:42 -0000       1.23
+++ utils/ncurses.cpp   9 Jan 2008 10:48:19 -0000       1.24
@@ -220,8 +220,8 @@
         for (int col = 1; col < 16; col++)
         {
             // Handle colors
-            int wm = m_game->getBoard().getWordMultiplier(row, col);
-            int lm = m_game->getBoard().getLetterMultiplier(row, col);
+            int wm = m_game->getBoard().GetWordMultiplier(row, col);
+            int lm = m_game->getBoard().GetLetterMultiplier(row, col);
             if (wm == 3)
                 wattron(win, COLOR_PAIR(COLOR_RED));
             else if (wm == 2)

Index: wxwin/gfxboard.cc
===================================================================
RCS file: /cvsroot/eliot/eliot/wxwin/gfxboard.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- wxwin/gfxboard.cc   4 Aug 2007 20:01:27 -0000       1.10
+++ wxwin/gfxboard.cc   9 Jan 2008 10:48:19 -0000       1.11
@@ -400,19 +400,19 @@
        {
            for (column = BOARD_MIN; column <= BOARD_MAX; column++)
                {
-                   if (board.getLetterMultiplier(row, column) == 2)
+                   if (board.GetLetterMultiplier(row, column) == 2)
                        {
                            dc->SetBrush(*Lx2Brush);
                        }
-                   else if (board.getLetterMultiplier(row, column) == 3)
+                   else if (board.GetLetterMultiplier(row, column) == 3)
                        {
                            dc->SetBrush(*Lx3Brush);
                        }
-                   else if (board.getWordMultiplier(row, column) == 2)
+                   else if (board.GetWordMultiplier(row, column) == 2)
                        {
                            dc->SetBrush(*Wx2Brush);
                        }
-                   else if (board.getWordMultiplier(row, column) == 3)
+                   else if (board.GetWordMultiplier(row, column) == 3)
                        {
                            dc->SetBrush(*Wx3Brush);
                        }




reply via email to

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