Skip to main content

Entrant

Trait Entrant 

Source
pub trait Entrant<S, R: Sides> {
    // Required methods
    fn name(&self) -> &str;
    fn start(&self, stage: &S, seed: u64) -> R;
    fn bots(&self, seed: u64) -> Vec<(R::Side, Box<dyn Bot<R>>)>;
    fn measure(&self) -> Box<dyn Measure<R>>;

    // Provided method
    fn record(&self, seed: u64, commands: &[R::Command]) -> Option<String> { ... }
}
Expand description

One named bot as the runner plays it, over the stage definition S (the data a stage is built from).

Required Methods§

Source

fn name(&self) -> &str

Its name, which checks and the report use.

Source

fn start(&self, stage: &S, seed: u64) -> R

The stage as this entrant plays it (a game with modes picks this entrant’s), its luck from seed.

Source

fn bots(&self, seed: u64) -> Vec<(R::Side, Box<dyn Bot<R>>)>

One bot per side for the try of seed.

Source

fn measure(&self) -> Box<dyn Measure<R>>

A fresh measure for a try.

Provided Methods§

Source

fn record(&self, seed: u64, commands: &[R::Command]) -> Option<String>

The try of seed as a record in the game’s own format, for replay, from the commands applied in order (play_try); None, the default, if it keeps none.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§