mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 01:59:36 +00:00
Simplify MovePickerExt<>
Now that we don't special case the root moves anymore we don't need to pass NodeType anymore as template parameter, a simple bool to detect a SpNode will be enough. Spotted by Joona. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
7902d6089e
commit
30b3edf328
1 changed files with 3 additions and 9 deletions
|
@ -216,14 +216,14 @@ namespace {
|
||||||
// MovePickerExt template class extends MovePicker and allows to choose at compile
|
// MovePickerExt template class extends MovePicker and allows to choose at compile
|
||||||
// time the proper moves source according to the type of node. In the default case
|
// time the proper moves source according to the type of node. In the default case
|
||||||
// we simply create and use a standard MovePicker object.
|
// we simply create and use a standard MovePicker object.
|
||||||
template<NodeType> struct MovePickerExt : public MovePicker {
|
template<bool SpNode> struct MovePickerExt : public MovePicker {
|
||||||
|
|
||||||
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value b)
|
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value b)
|
||||||
: MovePicker(p, ttm, d, h, ss, b) {}
|
: MovePicker(p, ttm, d, h, ss, b) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// In case of a SpNode we use split point's shared MovePicker object as moves source
|
// In case of a SpNode we use split point's shared MovePicker object as moves source
|
||||||
template<> struct MovePickerExt<SplitPointNonPV> : public MovePicker {
|
template<> struct MovePickerExt<true> : public MovePicker {
|
||||||
|
|
||||||
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value b)
|
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value b)
|
||||||
: MovePicker(p, ttm, d, h, ss, b), mp(ss->sp->mp) {}
|
: MovePicker(p, ttm, d, h, ss, b), mp(ss->sp->mp) {}
|
||||||
|
@ -232,12 +232,6 @@ namespace {
|
||||||
MovePicker* mp;
|
MovePicker* mp;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<> struct MovePickerExt<SplitPointPV> : public MovePickerExt<SplitPointNonPV> {
|
|
||||||
|
|
||||||
MovePickerExt(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss, Value b)
|
|
||||||
: MovePickerExt<SplitPointNonPV>(p, ttm, d, h, ss, b) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Overload operator<<() to make it easier to print moves in a coordinate
|
// Overload operator<<() to make it easier to print moves in a coordinate
|
||||||
// notation compatible with UCI protocol.
|
// notation compatible with UCI protocol.
|
||||||
std::ostream& operator<<(std::ostream& os, Move m) {
|
std::ostream& operator<<(std::ostream& os, Move m) {
|
||||||
|
@ -946,7 +940,7 @@ namespace {
|
||||||
split_point_start: // At split points actual search starts from here
|
split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
// Initialize a MovePicker object for the current position
|
// Initialize a MovePicker object for the current position
|
||||||
MovePickerExt<NT> mp(pos, ttMove, depth, H, ss, PvNode ? -VALUE_INFINITE : beta);
|
MovePickerExt<SpNode> mp(pos, ttMove, depth, H, ss, PvNode ? -VALUE_INFINITE : beta);
|
||||||
CheckInfo ci(pos);
|
CheckInfo ci(pos);
|
||||||
ss->bestMove = MOVE_NONE;
|
ss->bestMove = MOVE_NONE;
|
||||||
futilityBase = ss->eval + ss->evalMargin;
|
futilityBase = ss->eval + ss->evalMargin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue