UCI buttons don't need a value

Take advantage of this to further simplify the code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-03-17 21:18:02 +01:00
parent 9b26356347
commit 55376219b7
3 changed files with 10 additions and 17 deletions

View File

@@ -39,10 +39,9 @@ public:
UCIOption(int v, int min, int max, Fn* = NULL);
void operator=(const std::string& v);
void operator=(bool v) { *this = std::string(v ? "true" : "false"); }
operator int() const {
assert(type == "check" || type == "button" || type == "spin");
assert(type == "check" || type == "spin");
return (type == "spin" ? atoi(currentValue.c_str()) : currentValue == "true");
}