1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Use templetized operations for Piece

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-08-18 16:54:59 +01:00
parent 8e31764c49
commit 13bd0cff0d
3 changed files with 0 additions and 19 deletions

View file

@ -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);
} }

View file

@ -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]);
} }

View file

@ -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);
} }