eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] Changes to eliot/game/round.h


From: eliot-dev
Subject: [Eliot-dev] Changes to eliot/game/round.h
Date: Sat, 05 Nov 2005 06:02:02 -0500

Index: eliot/game/round.h
diff -u eliot/game/round.h:1.7 eliot/game/round.h:1.8
--- eliot/game/round.h:1.7      Fri Nov  4 20:00:06 2005
+++ eliot/game/round.h  Sat Nov  5 11:01:58 2005
@@ -23,12 +23,10 @@
 
 #include <vector>
 #include "tile.h"
+#include "coord.h"
 
 using namespace std;
 
-enum Tdirection {VERTICAL, HORIZONTAL};
-typedef enum Tdirection Direction;
-
 
 /**
  * A Round is the representation of a played word (or going to be played).
@@ -58,10 +56,7 @@
     /*************************
      * General setters
      *************************/
-    void setRow(int iRow)          { m_row = iRow; }
-    void setCol(int iCol)          { m_col = iCol; }
     void setPoints(int iPoints)    { m_points = iPoints; }
-    void setDir(Direction iDir)    { m_dir = iDir; }
     void setBonus(bool iBonus)     { m_bonus = iBonus; }
     void setTile(int iIndex, const Tile &iTile) { m_word[iIndex] = iTile; }
     void setWord(const vector<Tile> &iTiles);
@@ -70,27 +65,29 @@
     void setJoker(int iIndex, bool value = true);
 
     /*************************
-     *
+     * General getters
      *************************/
-    bool isJoker(int iIndex) const;
-    const Tile& getTile(int iIndex) const;
-    int getWordLen() const;
+    bool isJoker         (int iIndex) const;
     bool isPlayedFromRack(int iIndex) const;
+    const Tile& getTile  (int iIndex) const;
+    int getWordLen() const;
+    int getPoints()  const      { return m_points; }
+    int getBonus()   const      { return m_bonus; }
 
     /*************************
-     * General getters
+     * Coordinates
      *************************/
-    int getRow() const          { return m_row; }
-    int getCol() const          { return m_col; }
-    int getPoints() const       { return m_points; }
-    int getBonus() const        { return m_bonus; }
-    Direction getDir() const    { return m_dir; }
+    int getRow() const                 { return m_coord.getRow(); }
+    int getCol() const                 { return m_coord.getCol(); }
+    Coord::Direction getDir() const    { return m_coord.getDir(); }
+    void setRow(int iRow)              { m_coord.setRow(iRow); }
+    void setCol(int iCol)              { m_coord.setCol(iCol); }
+    void setDir(Coord::Direction iDir) { m_coord.setDir(iDir); }
 
 private:
     vector<Tile> m_word;
     vector<char> m_tileOrigin;
-    Direction m_dir;
-    int m_row, m_col;
+    Coord m_coord;
     int m_points;
     int m_bonus;
 };




reply via email to

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