fmt: reformatted code, changed some function signatures, fairly minor
This commit is contained in:
parent
76c0c3ce8b
commit
21fae88bdb
5 changed files with 216 additions and 50 deletions
16
Piece.cpp
16
Piece.cpp
|
|
@ -18,11 +18,11 @@ Piece::~Piece() {
|
|||
// so this is just a stub that does nothing. it doesn't matter
|
||||
// because only the derived class versions should be called.
|
||||
|
||||
std::vector<Move> Piece::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Piece::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
return moveList;
|
||||
}
|
||||
bool King::checkForCheck() const {
|
||||
bool King::checkForCheck(Board &board) const {
|
||||
std::vector<std::vector<int>> kingVulnerable = {
|
||||
{-1, 0}, // Up
|
||||
{-1, -1}, // up-left
|
||||
|
|
@ -45,7 +45,7 @@ bool King::checkForCheck() const {
|
|||
return inCheck;
|
||||
}
|
||||
|
||||
std::vector<Move> King::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> King::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
std::vector<std::vector<int>> directions = {
|
||||
{-1, 0}, // Up
|
||||
|
|
@ -156,7 +156,7 @@ std::vector<Move> King::getLegalMoves(const Square &from, const Board &board) co
|
|||
return moveList;
|
||||
}
|
||||
|
||||
std::vector<Move> Rook::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
const int directions[4][2] = {
|
||||
{-1, 0}, // Up
|
||||
|
|
@ -186,22 +186,22 @@ std::vector<Move> Rook::getLegalMoves(const Square &from, const Board &board) co
|
|||
return moveList;
|
||||
}
|
||||
|
||||
std::vector<Move> Queen::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
return moveList;
|
||||
}
|
||||
|
||||
std::vector<Move> Knight::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
return moveList;
|
||||
}
|
||||
|
||||
std::vector<Move> Bishop::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
return moveList;
|
||||
}
|
||||
|
||||
std::vector<Move> Pawn::getLegalMoves(const Square &from, const Board &board) const {
|
||||
std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const {
|
||||
std::vector<Move> moveList;
|
||||
const int directions[2][4][2] = {
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue