mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Retire push_button() and button_was_pressed()
Directly access the underlying bool option. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -286,7 +286,7 @@ void set_option_value(const string& name, const string& value) {
|
||||
if (opt.type == CHECK && v != "0" && v != "1")
|
||||
return;
|
||||
|
||||
else if (opt.type == SPIN)
|
||||
if (opt.type == SPIN)
|
||||
{
|
||||
int val = atoi(v.c_str());
|
||||
if (val < opt.minValue || val > opt.maxValue)
|
||||
@@ -294,26 +294,3 @@ void set_option_value(const string& name, const string& value) {
|
||||
}
|
||||
opt.currentValue = v;
|
||||
}
|
||||
|
||||
|
||||
/// push_button() is used to tell the engine that a UCI parameter of type
|
||||
/// "button" has been selected:
|
||||
|
||||
void push_button(const string& buttonName) {
|
||||
|
||||
set_option_value(buttonName, "true");
|
||||
}
|
||||
|
||||
|
||||
/// button_was_pressed() tests whether a UCI parameter of type "button" has
|
||||
/// been selected since the last time the function was called, in this case
|
||||
/// it also resets the button.
|
||||
|
||||
bool button_was_pressed(const string& buttonName) {
|
||||
|
||||
if (!get_option_value<bool>(buttonName))
|
||||
return false;
|
||||
|
||||
set_option_value(buttonName, "false");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user