Explicitly pass RootMoves to TB probes

Currently Search::RootMoves is accessed and even
modified by TB probing functions in a hidden
and sneaky way.

This is bad practice and makes the code tricky.
Instead explicily pass the vector as function
argument so to clarify that the vector is modified
inside the functions.

No functional change.
This commit is contained in:
Marco Costalba
2014-11-30 14:59:09 +01:00
committed by Joona Kiiski
parent eeb6d923fa
commit ba1464751d
5 changed files with 47 additions and 44 deletions
+5 -3
View File
@@ -1,15 +1,17 @@
#ifndef TBPROBE_H
#define TBPROBE_H
#include "../search.h"
namespace Tablebases {
extern int TBLargest;
extern int MaxCardinality;
void init(const std::string& path);
int probe_wdl(Position& pos, int *success);
int probe_dtz(Position& pos, int *success);
bool root_probe(Position& pos, Value& TBScore);
bool root_probe_wdl(Position& pos, Value& TBScore);
bool root_probe(Position& pos, Search::RootMoveVector& rootMoves, Value& score);
bool root_probe_wdl(Position& pos, Search::RootMoveVector& rootMoves, Value& score);
}