Skip to main content

Determinize

Trait Determinize 

Source
pub trait Determinize: Sides + Clone {
    // Required method
    fn determinize(&self, side: Self::Side, seed: u64) -> Self;
}
Expand description

A game that can make a copy of itself as one side knows it.

Required Methods§

Source

fn determinize(&self, side: Self::Side, seed: u64) -> Self

A copy of the state as side knows it, with everything side can’t see redrawn from seed: the luck to come (a new SimRng::new(seed)), and the other sides’ hidden things (a hand dealt again from what is left, a piece that hasn’t shown up yet removed).

The copy must list the same legal_commands as self, in the same order, and accept each of them: the Rollout and TurnPlan bots check the list and panic when it differs.

A game with no luck and nothing hidden returns self.clone() and says so in a comment. A game whose difficulty lets a bot see more says so here.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§