dev: Updates to Board and Piece, formatted code
This commit is contained in:
parent
8e381cf109
commit
f05dd6d90f
6 changed files with 122 additions and 121 deletions
107
Piece.cpp
107
Piece.cpp
|
|
@ -35,17 +35,16 @@ bool Piece::finalMoveChecks(std::vector<Move> *moveList, Board &board) {
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
// ##
|
||||
// ## ##
|
||||
// ##
|
||||
// ## ## ## # ## ####
|
||||
// ## # ## ## ## ## #
|
||||
// ### ## ## ## ## #
|
||||
// ## # ## ## ## ###
|
||||
// ## ## ## ## ### ##
|
||||
// ####
|
||||
// # #
|
||||
// ####
|
||||
//
|
||||
// ## #
|
||||
// #
|
||||
// # ## ## # ## ## #
|
||||
// # # # # # # #
|
||||
// ## # # # # #
|
||||
// # # # # # # #
|
||||
// ## ## ##### ### ## ###
|
||||
// #
|
||||
// ###
|
||||
// *INDENT-ON*
|
||||
bool King::checkForCheck(Board &board) const {
|
||||
std::vector<std::vector<int>> kingVulnerable = {
|
||||
|
|
@ -182,13 +181,15 @@ std::vector<Move> King::getLegalMoves(const Square &from, Board &board) const {
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
// ##
|
||||
// ##
|
||||
// ## # ### ### ## ##
|
||||
// #### ## ## ## ## ## #
|
||||
// ## ## ## ## ## ###
|
||||
// ## ## ## ## ## ## #
|
||||
// ## ### ### ## ##
|
||||
//
|
||||
// ##
|
||||
// #
|
||||
// # ### ## ## # ##
|
||||
// # # # # # # #
|
||||
// # # # # # ##
|
||||
// # # # # # # #
|
||||
// #### ## ## ## ##
|
||||
//
|
||||
// *INDENT-OM*
|
||||
|
||||
std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
|
||||
|
|
@ -222,13 +223,13 @@ std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
// ### ## ## ### ### # ##
|
||||
// ## # ## # ## # ## # ## ##
|
||||
// ## # ## # #### #### ## ##
|
||||
// ## # ## # ## ## ## ##
|
||||
// ### ### ### ### ## ###
|
||||
// ##
|
||||
// ###
|
||||
// ## # ## ## ## ## # ##
|
||||
// # # # # # # # # # #
|
||||
// # # # # ### ### # #
|
||||
// # # # # # # # #
|
||||
// ### ## # ### ### ### ##
|
||||
// #
|
||||
// ###
|
||||
// *INDENT-ON*
|
||||
|
||||
std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
|
||||
|
|
@ -269,18 +270,15 @@ std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
//
|
||||
// ##
|
||||
// ## ## ## #
|
||||
// ## ## ##
|
||||
// ## ## # ## ## #### #### ###
|
||||
// ## # ## ## ## ## # ## # ##
|
||||
// ### ## ## ## ## # ## # ##
|
||||
// ## # ## ## ## ### ## # ##
|
||||
// ## ## ## ### ## ## ## ## ##
|
||||
// ####
|
||||
// # #
|
||||
// ####
|
||||
// ## # ## #
|
||||
// # # #
|
||||
// # ## # ## ## ## # ### ####
|
||||
// # # # # # # # # # #
|
||||
// ## # # # # # # # #
|
||||
// # # # # # # # # # # #
|
||||
// ## ## ### ## ##### ### ### ## ##
|
||||
// #
|
||||
// ###
|
||||
// *INDENT-ON*
|
||||
|
||||
std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const {
|
||||
|
|
@ -299,17 +297,15 @@ std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
//
|
||||
// ##
|
||||
// ## ## ##
|
||||
// ## ##
|
||||
// ### ## ## #### ### ###
|
||||
// ## # ## ## ## # ## ## ## #
|
||||
// ## # ## ### ## # ## ## ## #
|
||||
// ## # ## ## ## # ## ## ## #
|
||||
// ### ## ### ## ## ### ###
|
||||
// ##
|
||||
// ###
|
||||
// ## # ##
|
||||
// # #
|
||||
// ### ## ### ### ## # ##
|
||||
// # # # # # # # # # #
|
||||
// # # # ## # # # # # #
|
||||
// # # # # # # # # # #
|
||||
// #### ##### ### ### ## ## ###
|
||||
// #
|
||||
// ###
|
||||
// *INDENT-ON*
|
||||
|
||||
std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const {
|
||||
|
|
@ -324,13 +320,14 @@ std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const
|
|||
}
|
||||
|
||||
// *INDENT-OFF*
|
||||
// ### ## # # ## # ##
|
||||
// ## # # ## # # # ## ##
|
||||
// ## # ### # ### ## ##
|
||||
// ## # # # #### ## ##
|
||||
// ### ##### # # ## ###
|
||||
// ##
|
||||
// ###
|
||||
//
|
||||
// # ## ## # # ## # ##
|
||||
// # # # # # # # #
|
||||
// # # ### # # # # #
|
||||
// # # # # # # # #
|
||||
// ### ## # # # ### ##
|
||||
// #
|
||||
// ###
|
||||
// *INDENT-ON*
|
||||
|
||||
std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue