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§
Sourcefn get_actions(&self) -> Vec<A>
fn get_actions(&self) -> Vec<A>
Returns the actions that can be taken from this state.
Sourcefn apply_action(&mut self, action: &A)
fn apply_action(&mut self, action: &A)
Applies the given action to this state.
Sourcefn get_reward_for_player(&self, player: P) -> f32
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.