[][src]Trait sttt::game::State

pub trait State<P, M>: Clone + Eq {
    type MoveIter: Iterator<Item = M>;
    fn new() -> Self;
fn is_done(&self);
fn winner(&self) -> Option<P>;
fn next_player(&self) -> Option<P>;
fn available_moves(&self) -> Self::MoveIter;
fn random_available_move<R: Rng>(&self, rand: &mut R) -> Option<M>;
fn play(&mut self, mv: M); }

Associated Types

type MoveIter: Iterator<Item = M>

Loading content...

Required methods

fn new() -> Self

fn is_done(&self)

fn winner(&self) -> Option<P>

fn next_player(&self) -> Option<P>

fn available_moves(&self) -> Self::MoveIter

fn random_available_move<R: Rng>(&self, rand: &mut R) -> Option<M>

fn play(&mut self, mv: M)

Loading content...

Implementors

Loading content...