mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Remove more types
This commit is contained in:
parent
d8d7be96af
commit
1e66854938
1 changed files with 0 additions and 54 deletions
54
src/types.h
54
src/types.h
|
@ -65,27 +65,6 @@ template<Color C, CastlingSide S> struct MakeCastling {
|
||||||
: S == QUEEN_SIDE ? BLACK_OOO : BLACK_OO;
|
: S == QUEEN_SIDE ? BLACK_OOO : BLACK_OO;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Phase {
|
|
||||||
PHASE_ENDGAME,
|
|
||||||
PHASE_MIDGAME = 128,
|
|
||||||
MG = 0, EG = 1, PHASE_NB = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ScaleFactor {
|
|
||||||
SCALE_FACTOR_DRAW = 0,
|
|
||||||
SCALE_FACTOR_ONEPAWN = 48,
|
|
||||||
SCALE_FACTOR_NORMAL = 64,
|
|
||||||
SCALE_FACTOR_MAX = 128,
|
|
||||||
SCALE_FACTOR_NONE = 255
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Bound {
|
|
||||||
BOUND_NONE,
|
|
||||||
BOUND_UPPER,
|
|
||||||
BOUND_LOWER,
|
|
||||||
BOUND_EXACT = BOUND_UPPER | BOUND_LOWER
|
|
||||||
};
|
|
||||||
|
|
||||||
enum PieceType {
|
enum PieceType {
|
||||||
NO_PIECE_TYPE, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING,
|
NO_PIECE_TYPE, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING,
|
||||||
ALL_PIECES = 0,
|
ALL_PIECES = 0,
|
||||||
|
@ -99,18 +78,6 @@ enum Piece {
|
||||||
PIECE_NB = 16
|
PIECE_NB = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Depth {
|
|
||||||
|
|
||||||
ONE_PLY = 1,
|
|
||||||
|
|
||||||
DEPTH_ZERO = 0,
|
|
||||||
DEPTH_QS_CHECKS = 0,
|
|
||||||
DEPTH_QS_NO_CHECKS = -1,
|
|
||||||
DEPTH_QS_RECAPTURES = -5,
|
|
||||||
|
|
||||||
DEPTH_NONE = -6
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Square {
|
enum Square {
|
||||||
SQ_A1, SQ_B1, SQ_C1, SQ_D1, SQ_E1, SQ_F1, SQ_G1, SQ_H1,
|
SQ_A1, SQ_B1, SQ_C1, SQ_D1, SQ_E1, SQ_F1, SQ_G1, SQ_H1,
|
||||||
SQ_A2, SQ_B2, SQ_C2, SQ_D2, SQ_E2, SQ_F2, SQ_G2, SQ_H2,
|
SQ_A2, SQ_B2, SQ_C2, SQ_D2, SQ_E2, SQ_F2, SQ_G2, SQ_H2,
|
||||||
|
@ -145,20 +112,6 @@ enum Rank {
|
||||||
RANK_1, RANK_2, RANK_3, RANK_4, RANK_5, RANK_6, RANK_7, RANK_8, RANK_NB
|
RANK_1, RANK_2, RANK_3, RANK_4, RANK_5, RANK_6, RANK_7, RANK_8, RANK_NB
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// The Score enum stores a middlegame and an endgame value in a single integer
|
|
||||||
/// (enum). The least significant 16 bits are used to store the endgame value
|
|
||||||
/// and the upper 16 bits are used to store the middlegame value. The compiler
|
|
||||||
/// is free to choose the enum type as long as it can store the data, so we
|
|
||||||
/// ensure that Score is an integer type by assigning some big int values.
|
|
||||||
enum Score {
|
|
||||||
SCORE_ZERO,
|
|
||||||
SCORE_ENSURE_INTEGER_SIZE_P = INT_MAX,
|
|
||||||
SCORE_ENSURE_INTEGER_SIZE_N = INT_MIN
|
|
||||||
};
|
|
||||||
|
|
||||||
inline Score make_score(int mg, int eg) { return Score((mg << 16) + eg); }
|
|
||||||
|
|
||||||
#define ENABLE_BASE_OPERATORS_ON(T) \
|
#define ENABLE_BASE_OPERATORS_ON(T) \
|
||||||
inline T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \
|
inline T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \
|
||||||
inline T operator-(T d1, T d2) { return T(int(d1) - int(d2)); } \
|
inline T operator-(T d1, T d2) { return T(int(d1) - int(d2)); } \
|
||||||
|
@ -169,8 +122,6 @@ inline T& operator+=(T& d1, T d2) { return d1 = d1 + d2; } \
|
||||||
inline T& operator-=(T& d1, T d2) { return d1 = d1 - d2; } \
|
inline T& operator-=(T& d1, T d2) { return d1 = d1 - d2; } \
|
||||||
inline T& operator*=(T& d, int i) { return d = T(int(d) * i); }
|
inline T& operator*=(T& d, int i) { return d = T(int(d) * i); }
|
||||||
|
|
||||||
ENABLE_BASE_OPERATORS_ON(Score)
|
|
||||||
|
|
||||||
#define ENABLE_FULL_OPERATORS_ON(T) \
|
#define ENABLE_FULL_OPERATORS_ON(T) \
|
||||||
ENABLE_BASE_OPERATORS_ON(T) \
|
ENABLE_BASE_OPERATORS_ON(T) \
|
||||||
inline T& operator++(T& d) { return d = T(int(d) + 1); } \
|
inline T& operator++(T& d) { return d = T(int(d) + 1); } \
|
||||||
|
@ -182,7 +133,6 @@ inline T& operator/=(T& d, int i) { return d = T(int(d) / i); }
|
||||||
ENABLE_FULL_OPERATORS_ON(PieceType)
|
ENABLE_FULL_OPERATORS_ON(PieceType)
|
||||||
ENABLE_FULL_OPERATORS_ON(Piece)
|
ENABLE_FULL_OPERATORS_ON(Piece)
|
||||||
ENABLE_FULL_OPERATORS_ON(Color)
|
ENABLE_FULL_OPERATORS_ON(Color)
|
||||||
ENABLE_FULL_OPERATORS_ON(Depth)
|
|
||||||
ENABLE_FULL_OPERATORS_ON(Square)
|
ENABLE_FULL_OPERATORS_ON(Square)
|
||||||
ENABLE_FULL_OPERATORS_ON(File)
|
ENABLE_FULL_OPERATORS_ON(File)
|
||||||
ENABLE_FULL_OPERATORS_ON(Rank)
|
ENABLE_FULL_OPERATORS_ON(Rank)
|
||||||
|
@ -190,10 +140,6 @@ ENABLE_FULL_OPERATORS_ON(Rank)
|
||||||
#undef ENABLE_FULL_OPERATORS_ON
|
#undef ENABLE_FULL_OPERATORS_ON
|
||||||
#undef ENABLE_BASE_OPERATORS_ON
|
#undef ENABLE_BASE_OPERATORS_ON
|
||||||
|
|
||||||
/// Only declared but not defined. We don't want to multiply two scores due to
|
|
||||||
/// a very high risk of overflow. So user should explicitly convert to integer.
|
|
||||||
inline Score operator*(Score s1, Score s2);
|
|
||||||
|
|
||||||
struct ExtMove {
|
struct ExtMove {
|
||||||
Move move;
|
Move move;
|
||||||
int value;
|
int value;
|
||||||
|
|
Loading…
Add table
Reference in a new issue