[][src]Trait oxymcts::GameTrait

pub trait GameTrait: Clone {
    type Player: Debug + Clone + Eq;
    type Move: Debug + Clone;
    fn legals_moves(&self) -> Vec<Self::Move>;
fn player_turn(&self) -> Self::Player;
fn hash(&self) -> u64;
fn is_final(&self) -> bool;
fn do_move(&mut self, m: &Self::Move);
fn get_winner(&self) -> Self::Player; }

Associated Types

type Player: Debug + Clone + Eq

type Move: Debug + Clone

Loading content...

Required methods

fn legals_moves(&self) -> Vec<Self::Move>

Returns a list of legal_move, for the actual player.

fn player_turn(&self) -> Self::Player

Return the player actually playing.

fn hash(&self) -> u64

Return if any the hash of the game state.

fn is_final(&self) -> bool

If the game is finished this return true.

fn do_move(&mut self, m: &Self::Move)

Play the move and alter the state.

fn get_winner(&self) -> Self::Player

If the game is finished this function returns the winner of the game.

Loading content...

Implementors

Loading content...