diff options
Diffstat (limited to 'piece.cpp')
-rw-r--r-- | piece.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/piece.cpp b/piece.cpp new file mode 100644 index 0000000..0d3eec1 --- /dev/null +++ b/piece.cpp @@ -0,0 +1,68 @@ +/* + * piece.cpp + * + * + */ + +#include "piece.h" + +Piece::Piece(string name_p, int row_p, int col_p, int w_p, int h_p, char dir_p) : name(name_p), + row(row_p), + col(col_p), + w(w_p), + h(h_p), + dir(dir_p) +{ +} + +string Piece::getName(void) +{ + return name; +} + +int Piece::getRow(void) +{ + return row; +} + +int Piece::getCol(void) +{ + return col; +} + +int Piece::getW(void) +{ + return w; +} + +int Piece::getH(void) +{ + return h; +} + +char Piece::getDir(void) +{ + return dir; +} + +/* mark the current position of the piece */ +void Piece::markPos(void) +{ + POINT curr = { row, col }; + haveBeen.push_back(curr); +} + +vector<POINT> *Piece::gethaveBeen(void) +{ + return &haveBeen; +} + +void Piece::setRow(int row_p) +{ + row = row_p; +} + +void Piece::setCol(int col_p) +{ + col = col_p; +} |