Introduce operator~(Piece c)

Small syntactic sugar to reverse piece color.

No functional change.
This commit is contained in:
Marco Costalba
2013-06-09 12:43:12 +02:00
parent 7e95495b35
commit db4cd89cb8
3 changed files with 11 additions and 7 deletions
+4
View File
@@ -359,6 +359,10 @@ inline Square operator~(Square s) {
return Square(s ^ 56); // Vertical flip SQ_A1 -> SQ_A8
}
inline Piece operator~(Piece c) {
return Piece(c ^ 8);
}
inline Square operator|(File f, Rank r) {
return Square((r << 3) | f);
}