[Move] Initial implementation
This commit is contained in:
19
Move.cpp
19
Move.cpp
@@ -2,11 +2,8 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
Move::Move(const Square &from, const Square &to,
|
||||
const std::optional<PieceType> &promotion) {
|
||||
(void) from;
|
||||
(void) to;
|
||||
(void) promotion;
|
||||
Move::Move(const Square &from, const Square &to, const std::optional<PieceType> &promotion)
|
||||
: mFrom(from), mTo(to), mPromotion(promotion) {
|
||||
}
|
||||
|
||||
Move::Optional Move::fromUci(const std::string &uci) {
|
||||
@@ -15,15 +12,15 @@ Move::Optional Move::fromUci(const std::string &uci) {
|
||||
}
|
||||
|
||||
Square Move::from() const {
|
||||
return Square::A1;
|
||||
return mFrom;
|
||||
}
|
||||
|
||||
Square Move::to() const {
|
||||
return Square::A1;
|
||||
return mTo;
|
||||
}
|
||||
|
||||
std::optional<PieceType> Move::promotion() const {
|
||||
return std::nullopt;
|
||||
return mPromotion;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Move &move) {
|
||||
@@ -38,7 +35,7 @@ bool operator<(const Move &lhs, const Move &rhs) {
|
||||
}
|
||||
|
||||
bool operator==(const Move &lhs, const Move &rhs) {
|
||||
(void) lhs;
|
||||
(void) rhs;
|
||||
return false;
|
||||
return lhs.from() == rhs.from()
|
||||
&& lhs.to() == rhs.to()
|
||||
&& lhs.promotion() == rhs.promotion();
|
||||
}
|
||||
|
Reference in New Issue
Block a user