[Piece] Implement constructor and type and color getters
This commit is contained in:
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
Piece::Piece(PieceColor color, PieceType type)
|
Piece::Piece(PieceColor color, PieceType type) : _color(color), _type(type) {
|
||||||
{
|
|
||||||
(void)color;
|
|
||||||
(void)type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Piece::Optional Piece::fromSymbol(char symbol) {
|
Piece::Optional Piece::fromSymbol(char symbol) {
|
||||||
@@ -14,11 +11,11 @@ Piece::Optional Piece::fromSymbol(char symbol) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PieceColor Piece::color() const {
|
PieceColor Piece::color() const {
|
||||||
return PieceColor::Black;
|
return _color;
|
||||||
}
|
}
|
||||||
|
|
||||||
PieceType Piece::type() const {
|
PieceType Piece::type() const {
|
||||||
return PieceType::Pawn;
|
return _type;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Piece &lhs, const Piece &rhs) {
|
bool operator==(const Piece &lhs, const Piece &rhs) {
|
||||||
|
Reference in New Issue
Block a user