拆分多个文件。

This commit is contained in:
unlockable
2023-03-01 17:06:16 +08:00
parent b86ed536c4
commit 6070fbfd57
5 changed files with 439 additions and 395 deletions

View File

@@ -0,0 +1,45 @@
#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 "";
}
}