|
BenBot 1.7.5
A chess engine
|
#include <libchess/uci/Options.hpp>
Public Types | |
| using | Callback = std::function<void(int)> |
| using | Value = int |
| using | Variant = std::variant<bool, int, string_view> |
Public Member Functions | |
| IntOption (string name, int minValue, int maxValue, int defaultValue, string helpString, Callback &&changeCallback=[](int) { }) | |
| auto | get_declaration_string () const -> string override |
| auto | get_default_value () const noexcept -> int |
| auto | get_default_value_variant () const -> Variant override |
| auto | get_help () const noexcept -> string_view override |
| auto | get_name () const noexcept -> string_view override |
| auto | get_type () const noexcept -> string_view override |
| auto | get_value () const noexcept -> int |
| auto | get_value_variant () const -> Variant override |
| void | handle_setvalue (string_view arguments) override |
| virtual auto | has_value () const noexcept -> bool |
| void | set_value (int newValue) |
An integer option.
Definition at line 141 of file Options.hpp.
| using chess::uci::IntOption::Callback = std::function<void(int)> |
Definition at line 143 of file Options.hpp.
| using chess::uci::IntOption::Value = int |
Definition at line 142 of file Options.hpp.
|
inherited |
Represents a variant that can hold any of the derived class's value types.
Definition at line 68 of file Options.hpp.
| chess::uci::IntOption::IntOption | ( | string | name, |
| int | minValue, | ||
| int | maxValue, | ||
| int | defaultValue, | ||
| string | helpString, | ||
| Callback && | changeCallback = [](int) { } ) |
Creates an integer option.
|
nodiscardoverridevirtual |
Returns the option's declaration string suitable for sending to the GUI. The returned string includes the "option" token.
Implements chess::uci::Option.
|
inlinenodiscardnoexcept |
Returns this option's default value.
Definition at line 164 of file Options.hpp.
|
inlinenodiscardoverridevirtual |
Returns this option's default value, as a variant. Note that if has_value() returns false, you must not call this method!
Implements chess::uci::Option.
Definition at line 166 of file Options.hpp.
|
inlinenodiscardoverridevirtualnoexcept |
Returns the help string for this option.
Implements chess::uci::Option.
Definition at line 174 of file Options.hpp.
|
inlinenodiscardoverridevirtualnoexcept |
Returns this option's name.
Implements chess::uci::Option.
Definition at line 168 of file Options.hpp.
|
inlinenodiscardoverridevirtualnoexcept |
Returns a textual representation of this option's type.
Implements chess::uci::Option.
Definition at line 172 of file Options.hpp.
|
inlinenodiscardnoexcept |
Returns this option's current value, as set by the last call to parse().
Definition at line 156 of file Options.hpp.
|
inlinenodiscardoverridevirtual |
Returns this option's current value, as a variant. Note that if has_value() returns false, you must not call this method!
Implements chess::uci::Option.
Definition at line 161 of file Options.hpp.
|
overridevirtual |
Will be called with everything in the "setoption" command after the option name. This is typically not called directly by user code.
Implements chess::uci::Option.
|
inlinenodiscardvirtualnoexceptinherited |
Returns true if this option type has an associated value. False only for Action options.
Reimplemented in chess::uci::Action.
Definition at line 65 of file Options.hpp.
| void chess::uci::IntOption::set_value | ( | int | newValue | ) |
Sets the option's value directly.