[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] Changes to eliot/game/coord.h
From: |
eliot-dev |
Subject: |
[Eliot-dev] Changes to eliot/game/coord.h |
Date: |
Sat, 05 Nov 2005 08:57:02 -0500 |
Index: eliot/game/coord.h
diff -u eliot/game/coord.h:1.4 eliot/game/coord.h:1.5
--- eliot/game/coord.h:1.4 Fri Nov 4 23:26:03 2005
+++ eliot/game/coord.h Sat Nov 5 13:56:59 2005
@@ -35,19 +35,25 @@
enum Direction {VERTICAL, HORIZONTAL};
- Coord();
+ // Construction, destruction
+ Coord(int iRow = -1, int iCol = -1, Direction iDir = HORIZONTAL);
Coord(const string &iStr);
- virtual ~Coord();
+ virtual ~Coord() {}
- void setRow(int iRow);
- void setCol(int iCol);
- void setDir(Direction iDir);
-
- Direction getDir() const;
- int getRow() const;
- int getCol() const;
+ // Accessors
+ void setRow(int iRow) { m_row = iRow; }
+ void setCol(int iCol) { m_col = iCol; }
+ void setDir(Direction iDir) { m_dir = iDir; }
+ int getRow() const { return m_row; }
+ int getCol() const { return m_col; }
+ Direction getDir() const { return m_dir; }
+ bool isValid() const;
void operator=(const Coord &iOther);
+
+ // Swap the coordinates (without changing the direction)
+ void swap();
+
void setFromString(const string &iStr);
string toString() const;