Struct ggp_rs::Game [−] [src]

pub struct Game {
    // some fields omitted
}

A description of a game. The methods of this object use a logic prover to find all true statements that satisfy a given query (i.e. find all legal moves). Note that queries are cached, so calling a method that performs a query twice will only pay for any necessary clones, another query will not be performed.

Methods

impl Game

fn is_terminal(&self, state: &State) -> bool

Returns true if state is a terminal state

fn roles(&self) -> &Vec<Role>

Returns the roles of the game

fn role(&self) -> &Role

Returns role of the player

fn initial_state(&self) -> &State

Returns the initial state of the game

fn current_state(&self) -> &State

Returns the current state of the game

fn legal_moves(&self, state: &State, role: &Role) -> Vec<Move>

Returns all legal moves for role role in the state state

fn legal_joint_moves(&self, state: &State) -> Vec<Vec<Move>>

Returns all legal joint moves in state state. Each element of the resulting vector is a vector that contains a legal move for each player in the game.

fn goals(&self, state: &State) -> Vec<Score>

Returns the score for each player in state state

fn goal(&self, state: &State, role: &Role) -> Score

Returns the score for role role in state state

fn next_states(&self, state: &State) -> Vec<State>

Gets all possible next states given state state

fn next_state(&self, state: &State, moves: &[Move]) -> State

Gets the next state given state state and each players' next move

fn start_clock(&self) -> u32

Gets the start clock time

fn play_clock(&self) -> u32

Gets the play clock time

fn move_start_time(&self) -> PreciseTime

Gets the PreciseTime at which the current move started.