X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftypes.h;h=863e0df2f771be35033dd9e22debaa7d524f4203;hb=25b4d0c127af9fe564f7a797460bed4c2837bcc2;hp=873c18854c81a4db162aa7b3e35e9ca5fc6a2c19;hpb=ae2f5f25cd8a6bc2762eefc032436052c0db679e;p=stockfish diff --git a/src/types.h b/src/types.h index 873c1885..863e0df2 100644 --- a/src/types.h +++ b/src/types.h @@ -252,6 +252,15 @@ enum ScaleFactor { SCALE_FACTOR_NONE = 255 }; +enum CastleRight { + CASTLES_NONE = 0, + WHITE_OO = 1, + BLACK_OO = 2, + WHITE_OOO = 4, + BLACK_OOO = 8, + ALL_CASTLES = 15 +}; + /// Score enum keeps a midgame and an endgame value in a single /// integer (enum), first LSB 16 bits are used to store endgame @@ -339,6 +348,7 @@ const Value QueenValueEndgame = Value(0x9FE); extern const Value PieceValueMidgame[17]; extern const Value PieceValueEndgame[17]; +extern int SquareDistance[64][64]; inline Value piece_value_midgame(Piece p) { return PieceValueMidgame[p]; @@ -431,7 +441,7 @@ inline int rank_distance(Square s1, Square s2) { } inline int square_distance(Square s1, Square s2) { - return Max(file_distance(s1, s2), rank_distance(s1, s2)); + return SquareDistance[s1][s2]; } inline char file_to_char(File f) {