eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] Changes to eliot/game/game.cpp [antoine-1]


From: eliot-dev
Subject: [Eliot-dev] Changes to eliot/game/game.cpp [antoine-1]
Date: Sun, 23 Oct 2005 16:58:54 -0400

Index: eliot/game/game.cpp
diff -u eliot/game/game.cpp:1.15.2.2 eliot/game/game.cpp:1.15.2.3
--- eliot/game/game.cpp:1.15.2.2        Sun Oct 23 18:38:18 2005
+++ eliot/game/game.cpp Sun Oct 23 20:58:20 2005
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *****************************************************************************/
 
-/* $Id: game.cpp,v 1.15.2.2 2005/10/23 18:38:18 afrab Exp $ */
-
 /**
  *  \file   game.cpp
  *  \brief  Eliot game class
@@ -55,8 +53,7 @@
 {
 }
 
-const Player&
-Game::getPlayer(int num) const
+const Player& Game::getPlayer(int num) const
 {
     ASSERT(0 <= num && num < (int)m_players.size(),"Wrong player number");
     return *(m_players[num]);
@@ -72,25 +69,25 @@
     m_players.push_back(new AIPercent(0));
 }
 
-int Game::play(int player, const std::string iCoord, const std::string iWord)
+int Game::play(int player, const std::string &iCoord, const std::string &iWord)
 {
-    return play(player,Coord(iCoord),iWord);
+    return play(player, Coord(iCoord), iWord);
 }
 
 int Game::play(int player, const Coord& iCoord, const std::string &iWord)
 {
     Round round;
-    checkPlayedWord(iCoord,iWord,round);
-    return play(player,round);
+    checkPlayedWord(iCoord, iWord, round);
+    return play(player, round);
 }
 
 int Game::back(int n)
 {
     int i;
-    for(i=0; i<n; i++)
-       {
-           back();
-       }
+    for (i = 0; i < n; i++)
+    {
+        back();
+    }
     return 0;
 }
 
@@ -125,7 +122,7 @@
      * and specify the origin of each letter (board or rack) */
     res = m_board.checkRound(oRound, m_history.getSize() == 1);
     if (res != 0)
-       return res + 4;
+    return res + 4;
 
     /* Check that the word can be formed with the tiles in the rack:
      * we first create a copy of the rack, then we remove the tiles
@@ -161,18 +158,15 @@
     return checkPlayedWord(oRound);
 }
 
-int Game::setRack(int player, PlayedRack::set_rack_mode mode, bool check, 
std::string rack)
+int Game::setRack(int player, PlayedRack::set_rack_mode mode, bool check, 
const std::string &iRack)
 {
-    int result;
-    PlayedRack newrack;
-
-    newrack = m_players[player]->getCurrentRack();
-    result = newrack.replace(m_bag,mode,rack);
+    PlayedRack newrack = m_players[player]->getCurrentRack();
+    int result = newrack.replace(m_bag,mode, iRack);
     m_players[player]->setCurrentRack(newrack);
     return result;
 }
 
-
+
 /// Local Variables:
 /// mode: hs-minor
 /// c-basic-offset: 4




reply via email to

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