summaryrefslogtreecommitdiff
path: root/src/Board.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-01-30 13:14:58 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-01-30 13:14:58 +0100
commitf42a6ac20b9f14fd391269cd90606d91a592b2f1 (patch)
treea432460e6f16da333d66a8b49c773edea1687aab /src/Board.cpp
parent159d5334128ff0bb90a8e4e85739dc8bc44baad8 (diff)
Cleaning code
Diffstat (limited to 'src/Board.cpp')
-rw-r--r--src/Board.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Board.cpp b/src/Board.cpp
index 0e88423..a107c02 100644
--- a/src/Board.cpp
+++ b/src/Board.cpp
@@ -72,8 +72,8 @@ std::string Board::GetKingLocation(bool isBlack) {
}
void Board::Move(std::string move) {
- std::string src(move.substr(0, 2));
- std::string dst(move.substr(2, 2));
+ std::string src = move.substr(0, 2);
+ std::string dst = move.substr(2, 2);
for (Piece &p : pieces) {
if (p.coord == src) {
RemovePiece(dst); // Remove piece on dst if exists
@@ -99,8 +99,8 @@ std::string Board::Serialize() {
}
bool Board::IsMovePossible(std::string move) {
- std::string src(move.substr(0, 2));
- std::string dst(move.substr(2, 2));
+ std::string src = move.substr(0, 2);
+ std::string dst = move.substr(2, 2);
if (src == dst) {
return (false);
}