Skip to main content

PlaytestPlan

Struct PlaytestPlan 

Source
#[non_exhaustive]
pub struct PlaytestPlan { pub title: String, pub entrants: Vec<(String, Option<String>)>, pub groups: BTreeMap<String, Vec<String>>, pub default_entrants: Vec<String>, pub checks: PlaytestChecks, pub play: PlayTry, pub summary: Vec<Vec<Summary>>, }
Expand description

What playtest plays on one of the game’s stages (GameTools::playtest_plan): its entrants, its checks, and how one try is played. The command picks the entrants asked for, plays their tries on every core, times them and judges them once. Build it with PlaytestPlan::new and assign the rest (ADR-0039).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§title: String

Shown at the top of the report: the stage and its tier, say.

§entrants: Vec<(String, Option<String>)>

Every entrant, in report order: its name and a label (a mode), if any.

§groups: BTreeMap<String, Vec<String>>

Named groups of entrants ("all"), which --entrant takes too.

§default_entrants: Vec<String>

The entrants that play when --entrant isn’t given (all of them if empty).

§checks: PlaytestChecks

The checks over the entrants that play, given their names: a check naming an entrant who doesn’t play is left out. None at all is a plain bot run: nothing is judged, and it passes when every try played.

§play: PlayTry

One try: of the entrant at that index of entrants, from that seed, stopped at that turn if it hasn’t ended, with the commands applied and its record for replay, if the game keeps one. Tries run on several threads at once, in any order; most simply play_try.

§summary: Vec<Vec<Summary>>

Each entrant’s summary items, in entrants order, printed on its line: won 83/100 · turns median 12. An entrant past the end, or with none, has no summary.

Implementations§

Source§

impl PlaytestPlan

Source

pub fn new( title: impl Into<String>, entrants: Vec<(String, Option<String>)>, checks: PlaytestChecks, play: PlayTry, ) -> Self

The plan titled title: entrants judged by checks, a try played by play. It has no groups and no summary, and every entrant plays unless --entrant says (default_entrants empty).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.