35 |
|
|
36 |
enum Direction {VERTICAL, HORIZONTAL}; |
enum Direction {VERTICAL, HORIZONTAL}; |
37 |
|
|
38 |
Coord(); |
// Construction, destruction |
39 |
|
Coord(int iRow = -1, int iCol = -1, Direction iDir = HORIZONTAL); |
40 |
Coord(const string &iStr); |
Coord(const string &iStr); |
41 |
virtual ~Coord(); |
virtual ~Coord() {} |
42 |
|
|
43 |
void setRow(int iRow); |
// Accessors |
44 |
void setCol(int iCol); |
void setRow(int iRow) { m_row = iRow; } |
45 |
void setDir(Direction iDir); |
void setCol(int iCol) { m_col = iCol; } |
46 |
|
void setDir(Direction iDir) { m_dir = iDir; } |
47 |
Direction getDir() const; |
int getRow() const { return m_row; } |
48 |
int getRow() const; |
int getCol() const { return m_col; } |
49 |
int getCol() const; |
Direction getDir() const { return m_dir; } |
50 |
|
|
51 |
|
bool isValid() const; |
52 |
void operator=(const Coord &iOther); |
void operator=(const Coord &iOther); |
53 |
|
|
54 |
|
// Swap the coordinates (without changing the direction) |
55 |
|
void swap(); |
56 |
|
|
57 |
void setFromString(const string &iStr); |
void setFromString(const string &iStr); |
58 |
string toString() const; |
string toString() const; |
59 |
|
|