Rewrite options handling in an object oriented fashion

Big rewrite and about 100 lines removed.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-11-04 08:03:27 +01:00
parent fb50e16cdd
commit bacb645939
9 changed files with 181 additions and 280 deletions

View File

@@ -114,10 +114,10 @@ void TimeManager::init(int myTime, int myInc, int movesToGo, int currentPly)
int hypMTG, hypMyTime, t1, t2;
// Read uci parameters
int emergencyMoveHorizon = get_option_value_int("Emergency Move Horizon");
int emergencyBaseTime = get_option_value_int("Emergency Base Time");
int emergencyMoveTime = get_option_value_int("Emergency Move Time");
int minThinkingTime = get_option_value_int("Minimum Thinking Time");
int emergencyMoveHorizon = Options["Emergency Move Horizon"].value<int>();
int emergencyBaseTime = Options["Emergency Base Time"].value<int>();
int emergencyMoveTime = Options["Emergency Move Time"].value<int>();
int minThinkingTime = Options["Minimum Thinking Time"].value<int>();
// Initialize to maximum values but unstablePVExtraTime that is reset
unstablePVExtraTime = 0;
@@ -137,7 +137,7 @@ void TimeManager::init(int myTime, int myInc, int movesToGo, int currentPly)
maximumSearchTime = Min(maximumSearchTime, t2);
}
if (get_option_value_bool("Ponder"))
if (Options["Ponder"].value<bool>())
optimumSearchTime += optimumSearchTime / 4;
// Make sure that maxSearchTime is not over absoluteMaxSearchTime