Trait gameai::game::Game [] [src]

pub trait Game: Clone + Send {
    type Move: Clone + Copy + Send + Ord;
    type Agent: PartialEq + Clone + Copy + Send + Ord;
    fn to_act(&self) -> Self::Agent;
fn player_weight(&self, _: &Self::Agent) -> Score;
fn winner(&self) -> Option<Self::Agent>;
fn agent_id(&self, _: &Self::Agent) -> u32;
fn ref_player(&self) -> Self::Agent;
fn new(_: &Self::Agent) -> Self;
fn possible_moves(&self) -> Vec<ValidMove<Self>>;
fn move_valid(&self, _: &Self::Move) -> bool;
fn has_won(&self, agent: &Self::Agent) -> bool;
fn apply(&mut self, _: Self::Move); fn try_move_mut(&mut self, m: Self::Move) -> bool { ... }
fn verify_move_mut(&mut self, m: Self::Move) -> Option<ValidMoveMut<Self>> { ... }
fn verify_move(self, m: Self::Move) -> Option<ValidMove<Self>> { ... }
fn has_winner(&self) -> bool { ... }
fn try_move(&mut self, m: Self::Move) -> bool { ... }
fn try_moves<I>(&mut self, moves: I) -> Vec<bool>
    where
        I: Iterator<Item = Self::Move>
, { ... } }

Associated Types

Required Methods

Provided Methods

Implementors