pub trait GameStrategy {
    type Player;
    type Move;
    type Board;

    fn evaluate(&self) -> f64;
    fn get_winner(&self) -> Option<Self::Player>;
    fn is_game_tied(&self) -> bool;
    fn is_game_complete(&self) -> bool;
    fn get_available_moves(&self) -> Vec<Self::Move>;
    fn play(&mut self, mv: &Self::Move, maximizer: bool);
    fn clear(&mut self, mv: &Self::Move);
    fn get_board(&self) -> &Self::Board;
    fn is_a_valid_move(&self, mv: &Self::Move) -> bool;
    fn get_a_sentinel_move(&self) -> Self::Move;
}

Required Associated Types

Required Methods

Ability to statically evaluate the current game state.

Identify a winner, if exists.

Identify if the game is tied.

Identify if the game is in a completed state.

Ability to produce a collection of playable legal moves in the current position.

Modify the game state by playing a given move.

Modify the game state by resetting a given move.

Get the current state of the board.

Determine if a given move is valid.

Ability to produce a sentinel (not-playable) move.

Implementors

Endow upon TicTacToe the ability to play games.