45 lines
769 B
C++
45 lines
769 B
C++
#include "fiveInARow.h"
|
|
|
|
ChessPiece::ChessPiece() {
|
|
this->isEmptyStatus = true;
|
|
this->isWinStatus = false;
|
|
this->color = BLACK;
|
|
}
|
|
|
|
ChessPiece::~ChessPiece() {
|
|
}
|
|
|
|
void ChessPiece::setColor(bool newColor) {
|
|
this->isEmptyStatus = false;
|
|
this->color = newColor;
|
|
}
|
|
|
|
void ChessPiece::setWin() {
|
|
this->isWinStatus = true;
|
|
}
|
|
|
|
void ChessPiece::reset() {
|
|
this->isEmptyStatus = true;
|
|
this->isWinStatus = false;
|
|
this->color = BLACK;
|
|
}
|
|
|
|
bool ChessPiece::isEmpty() {
|
|
return this->isEmptyStatus;
|
|
}
|
|
|
|
bool ChessPiece::getColor() {
|
|
return this->color;
|
|
}
|
|
|
|
std::string ChessPiece::show() {
|
|
if (this->isWinStatus) {
|
|
return "X";
|
|
}
|
|
if (this->color == BLACK) {
|
|
return "●";
|
|
}
|
|
else {
|
|
return "○";
|
|
}
|
|
} |