else if (token == "uci")
cout << "id name " << engine_name()
<< "\nid author " << engine_authors()
- << "\n" << Options.print_all()
+ << "\n" << Options
<< "\nuciok" << endl;
else
cout << "Unknown command: " << cmd << endl;
else
return;
- pos.from_fen(fen, Options["UCI_Chess960"].value<bool>());
+ pos.from_fen(fen, Options["UCI_Chess960"]);
// Parse move list (if any)
while (is >> token && (m = move_from_uci(pos, token)) != MOVE_NONE)
while (is >> token)
value += string(" ", !value.empty()) + token;
- if (Options.find(name) != Options.end())
- Options[name].set_value(value.empty() ? "true" : value); // UCI buttons don't have "value"
- else
+ if (!Options.count(name))
cout << "No such option: " << name << endl;
+
+ else if (value.empty()) // UCI buttons don't have a value
+ Options[name] = true;
+
+ else
+ Options[name] = value;
}