mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Move zobrist keys out of Position
Are used by Position but do not belong to that class, there is only one instance of them (that's why were defined as static), so move to a proper namespace instead. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -189,9 +189,6 @@ public:
|
||||
bool pos_is_ok(int* failedStep = NULL) const;
|
||||
void flip();
|
||||
|
||||
// Global initialization
|
||||
static void init();
|
||||
|
||||
private:
|
||||
// Initialization helpers (used while setting up a position)
|
||||
void clear();
|
||||
@@ -230,14 +227,6 @@ private:
|
||||
Thread* thisThread;
|
||||
StateInfo* st;
|
||||
int chess960;
|
||||
|
||||
// Static variables
|
||||
static Score pieceSquareTable[16][64]; // [piece][square]
|
||||
static Key zobrist[2][8][64]; // [color][pieceType][square]/[piece count]
|
||||
static Key zobEp[8]; // [file]
|
||||
static Key zobCastle[16]; // [castleRight]
|
||||
static Key zobSideToMove;
|
||||
static Key zobExclusion;
|
||||
};
|
||||
|
||||
inline int64_t Position::nodes_searched() const {
|
||||
@@ -366,7 +355,7 @@ inline Key Position::key() const {
|
||||
}
|
||||
|
||||
inline Key Position::exclusion_key() const {
|
||||
return st->key ^ zobExclusion;
|
||||
return st->key ^ Zobrist::exclusion;
|
||||
}
|
||||
|
||||
inline Key Position::pawn_key() const {
|
||||
|
||||
Reference in New Issue
Block a user