GameState

Trait GameState 

Source
pub trait GameState<A: GameAction, P: Player>: Clone {
    // Required methods
    fn get_actions(&self) -> Vec<A>;
    fn apply_action(&mut self, action: &A);
    fn get_turn(&self) -> P;
    fn get_reward_for_player(&self, player: P) -> f32;
}
Expand description

Represents a game state.

Required Methods§

Source

fn get_actions(&self) -> Vec<A>

Returns the actions that can be taken from this state.

Source

fn apply_action(&mut self, action: &A)

Applies the given action to this state.

Source

fn get_turn(&self) -> P

Returns the player whose turn it is.

Source

fn get_reward_for_player(&self, player: P) -> f32

Returns whether the game is over.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§