mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
PSQT access functions can be static
Also renamed history access value in something more in line with the meaning. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
40ad5194aa
commit
3578207974
4 changed files with 9 additions and 9 deletions
|
@ -85,10 +85,10 @@ void History::failure(Piece p, Square to, Depth d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// History::move_ordering_score() returns an integer value used to order the
|
/// History::value() returns an integer value used to order the
|
||||||
/// non-capturing moves in the MovePicker class.
|
/// non-capturing moves in the MovePicker class.
|
||||||
|
|
||||||
int History::move_ordering_score(Piece p, Square to) const {
|
int History::value(Piece p, Square to) const {
|
||||||
|
|
||||||
assert(piece_is_ok(p));
|
assert(piece_is_ok(p));
|
||||||
assert(square_is_ok(to));
|
assert(square_is_ok(to));
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
void clear();
|
void clear();
|
||||||
void success(Piece p, Square to, Depth d);
|
void success(Piece p, Square to, Depth d);
|
||||||
void failure(Piece p, Square to, Depth d);
|
void failure(Piece p, Square to, Depth d);
|
||||||
int move_ordering_score(Piece p, Square to) const;
|
int value(Piece p, Square to) const;
|
||||||
void set_gain(Piece p, Square to, Value delta);
|
void set_gain(Piece p, Square to, Value delta);
|
||||||
Value gain(Piece p, Square to) const;
|
Value gain(Piece p, Square to) const;
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ void MovePicker::score_noncaptures() {
|
||||||
from = move_from(m);
|
from = move_from(m);
|
||||||
to = move_to(m);
|
to = move_to(m);
|
||||||
piece = pos.piece_on(from);
|
piece = pos.piece_on(from);
|
||||||
cur->score = H.move_ordering_score(piece, to);
|
cur->score = H.value(piece, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ void MovePicker::score_evasions_or_checks() {
|
||||||
cur->score = pos.midgame_value_of_piece_on(move_to(m))
|
cur->score = pos.midgame_value_of_piece_on(move_to(m))
|
||||||
- pos.type_of_piece_on(move_from(m)) + HistoryMax;
|
- pos.type_of_piece_on(move_from(m)) + HistoryMax;
|
||||||
else
|
else
|
||||||
cur->score = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m));
|
cur->score = H.value(pos.piece_on(move_from(m)), move_to(m));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ public:
|
||||||
// Incremental evaluation
|
// Incremental evaluation
|
||||||
Score value() const;
|
Score value() const;
|
||||||
Value non_pawn_material(Color c) const;
|
Value non_pawn_material(Color c) const;
|
||||||
Score pst_delta(Piece piece, Square from, Square to) const;
|
static Score pst_delta(Piece piece, Square from, Square to);
|
||||||
|
|
||||||
// Game termination checks
|
// Game termination checks
|
||||||
bool is_mate() const;
|
bool is_mate() const;
|
||||||
|
@ -310,7 +310,7 @@ private:
|
||||||
Key compute_material_key() const;
|
Key compute_material_key() const;
|
||||||
|
|
||||||
// Computing incremental evaluation scores and material counts
|
// Computing incremental evaluation scores and material counts
|
||||||
Score pst(Color c, PieceType pt, Square s) const;
|
static Score pst(Color c, PieceType pt, Square s);
|
||||||
Score compute_value() const;
|
Score compute_value() const;
|
||||||
Value compute_non_pawn_material(Color c) const;
|
Value compute_non_pawn_material(Color c) const;
|
||||||
|
|
||||||
|
@ -507,11 +507,11 @@ inline Key Position::get_material_key() const {
|
||||||
return st->materialKey;
|
return st->materialKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Score Position::pst(Color c, PieceType pt, Square s) const {
|
inline Score Position::pst(Color c, PieceType pt, Square s) {
|
||||||
return PieceSquareTable[piece_of_color_and_type(c, pt)][s];
|
return PieceSquareTable[piece_of_color_and_type(c, pt)][s];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Score Position::pst_delta(Piece piece, Square from, Square to) const {
|
inline Score Position::pst_delta(Piece piece, Square from, Square to) {
|
||||||
return PieceSquareTable[piece][to] - PieceSquareTable[piece][from];
|
return PieceSquareTable[piece][to] - PieceSquareTable[piece][from];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue