lab.cpp/Chess/dep/Pieces/Piece.cpp

23 lines
521 B
C++
Raw Normal View History

2016-03-06 21:51:07 +00:00
Piece::Piece(PIECE_TYPE t, int x, int y) : _t(t), _x(x), _y(y){
}
// GETTERS
PIECE_TYPE Piece::gett() const{ return _t; }
int Piece::getx() const{ return _x; }
int Piece::gety() const{ return _y; }
// SETTERS
void Piece::move(const int x, const int y){
_x = x;
_y = y;
}
// OPERATEURS (SURCHARGE)
ostream& operator<<(ostream& o, const Piece& p){
return o << p._t << " at (" << p._x << "," << p._y << ")";
}
// ABTRACT
bool Piece::can(const int x, const int y){ return false; }
char Piece::getchar(){ return '?'; }