added to string for piece and colour
This commit is contained in:
parent
d8557d02df
commit
e376d67c83
@ -20,6 +20,36 @@ enum Colour : int8_t {
|
||||
Black = 16,
|
||||
};
|
||||
|
||||
inline const char* to_string(Colour c) {
|
||||
switch (c) {
|
||||
case White:
|
||||
return "White";
|
||||
case Black:
|
||||
return "Black";
|
||||
default:
|
||||
return "[Unknown Colour]";
|
||||
}
|
||||
}
|
||||
|
||||
inline const char* to_string(Piece c) {
|
||||
switch (c) {
|
||||
case Pawn:
|
||||
return "Pawn";
|
||||
case Rook:
|
||||
return "Rook";
|
||||
case Bishop:
|
||||
return "Bishop";
|
||||
case Knigt:
|
||||
return "Knight";
|
||||
case Queen:
|
||||
return "Queen";
|
||||
case King:
|
||||
return "King";
|
||||
default:
|
||||
return "[Unknown Colour]";
|
||||
}
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const int8_t& i) {
|
||||
os << std::to_string(i);
|
||||
return os;
|
||||
|
Loading…
x
Reference in New Issue
Block a user