-enum MovegenPhase {
- PH_TT_MOVES, // Transposition table move and mate killer
- PH_GOOD_CAPTURES, // Queen promotions and captures with SEE values >= 0
- PH_KILLERS, // Killer moves from the current ply
- PH_NONCAPTURES, // Non-captures and underpromotions
- PH_BAD_CAPTURES, // Queen promotions and captures with SEE values < 0
- PH_EVASIONS, // Check evasions
- PH_QCAPTURES, // Captures in quiescence search
- PH_QCHECKS, // Non-capture checks in quiescence search
- PH_STOP
+ const Value* operator[](Piece p) const { return &history[p][0]; }
+ Value gain(Piece p, Square to) const { return gains[p][to]; }
+
+ void clear();
+ void update(Piece p, Square to, Value bonus);
+ void update_gain(Piece p, Square to, Value gain);
+
+private:
+ Value history[PIECE_NB][SQUARE_NB];
+ Value gains[PIECE_NB][SQUARE_NB];