mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 08:13:08 +00:00
Use templetized operations for Piece
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
8e31764c49
commit
13bd0cff0d
3 changed files with 0 additions and 19 deletions
|
@ -42,8 +42,6 @@ enum SquareColor {
|
||||||
//// Inline functions
|
//// Inline functions
|
||||||
////
|
////
|
||||||
|
|
||||||
inline void operator++ (Color &c, int) { c = Color(int(c) + 1); }
|
|
||||||
|
|
||||||
inline Color opposite_color(Color c) {
|
inline Color opposite_color(Color c) {
|
||||||
return Color(int(c) ^ 1);
|
return Color(int(c) ^ 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,14 +58,6 @@ extern uint8_t SignedDirectionTable[64][64];
|
||||||
//// Inline functions
|
//// Inline functions
|
||||||
////
|
////
|
||||||
|
|
||||||
inline void operator++ (Direction& d, int) {
|
|
||||||
d = Direction(int(d) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void operator++ (SignedDirection& d, int) {
|
|
||||||
d = SignedDirection(int(d) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Direction direction_between_squares(Square s1, Square s2) {
|
inline Direction direction_between_squares(Square s1, Square s2) {
|
||||||
return Direction(DirectionTable[s1][s2]);
|
return Direction(DirectionTable[s1][s2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,15 +57,6 @@ const int SlidingArray[18] = {
|
||||||
//// Inline functions
|
//// Inline functions
|
||||||
////
|
////
|
||||||
|
|
||||||
inline Piece operator+ (Piece p, int i) { return Piece(int(p) + i); }
|
|
||||||
inline void operator++ (Piece &p, int) { p = Piece(int(p) + 1); }
|
|
||||||
inline Piece operator- (Piece p, int i) { return Piece(int(p) - i); }
|
|
||||||
inline void operator-- (Piece &p, int) { p = Piece(int(p) - 1); }
|
|
||||||
inline PieceType operator+ (PieceType p, int i) {return PieceType(int(p) + i);}
|
|
||||||
inline void operator++ (PieceType &p, int) { p = PieceType(int(p) + 1); }
|
|
||||||
inline PieceType operator- (PieceType p, int i) {return PieceType(int(p) - i);}
|
|
||||||
inline void operator-- (PieceType &p, int) { p = PieceType(int(p) - 1); }
|
|
||||||
|
|
||||||
inline PieceType type_of_piece(Piece p) {
|
inline PieceType type_of_piece(Piece p) {
|
||||||
return PieceType(int(p) & 7);
|
return PieceType(int(p) & 7);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue