pub trait IntoRunCondition {
type RunCondition: RunCondition;
// Required method
fn into_run_condition(self) -> Self::RunCondition;
}
Expand description
Converts a type into a RunCondition
used by Bot::select
.
It is recommended to mostly use Duration
.
§Examples
use std::time::Duration;
let available_time = Duration::from_secs(2);
let game: Game = // ...
let mut bot: Bot = // ...
assert!(bot.select(&game, available_time).is_some())
§Implementations
Duration
:select
runs for the specified durationToCompletion
:select
runs until it found the perfect actionDepth
:select
analyses up the to given depth and returns to best action at that depthInstant
:select
runs until the givenInstant
is in the pastLogger
: takes another run condition and stores information about the last call toselect
Required Associated Types§
Required Methods§
Sourcefn into_run_condition(self) -> Self::RunCondition
fn into_run_condition(self) -> Self::RunCondition
consumes self
and returns a RunCondition
.
Implementations on Foreign Types§
Source§impl IntoRunCondition for Duration
Creates a RunCondition
which returns true
until this Duration
has passed.
impl IntoRunCondition for Duration
Creates a RunCondition
which returns true
until this Duration
has passed.