Skip to main content

Sides

Trait Sides 

Source
pub trait Sides: TurnRules {
    type Side: Copy + Eq + Debug;

    // Required methods
    fn side_to_move(&self) -> Self::Side;
    fn turn(&self) -> u32;
}
Expand description

A game whose state says whose move it is and which turn it is, so a loop can ask the right bot for each command.

Required Associated Types§

Source

type Side: Copy + Eq + Debug

Who moves: a player, a faction, a phase.

Required Methods§

Source

fn side_to_move(&self) -> Self::Side

Who issues the next command.

Source

fn turn(&self) -> u32

The turn being played, counting from the game’s first.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§