[][src]Trait fox_and_hounds::game::Game

pub trait Game: Clone + Debug {
    type Move: Move;

    const SCORE_MAX: i32;
    const SCORE_MIN: i32;

    fn possible_moves(&self) -> Vec<Self::Move>;
fn execute_move(&self, mov: Self::Move) -> Self;
fn do_move(&mut self, mov: Self::Move) -> Self::Move;
fn undo_move(&mut self, mov: Self::Move);
fn get_score(&self) -> i32;
fn score_if_win_next_round(&self) -> i32;
fn is_game_over(&self) -> bool;
fn calculate_move<T: Algorithm>(
        &self,
        depth: i32,
        do_precalculated_moves: bool
    ) -> Option<Self::Move>; }

Associated Types

type Move: Move

Loading content...

Associated Constants

const SCORE_MAX: i32

const SCORE_MIN: i32

Loading content...

Required methods

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

fn execute_move(&self, mov: Self::Move) -> Self

fn do_move(&mut self, mov: Self::Move) -> Self::Move

fn undo_move(&mut self, mov: Self::Move)

fn get_score(&self) -> i32

fn score_if_win_next_round(&self) -> i32

fn is_game_over(&self) -> bool

fn calculate_move<T: Algorithm>(
    &self,
    depth: i32,
    do_precalculated_moves: bool
) -> Option<Self::Move>

Loading content...

Implementors

impl Game for FoxAndHounds[src]

type Move = FHMove

impl Game for NoughtsAndCrosses[src]

type Move = NCMove

Loading content...