Play

Trait Play 

Source
pub trait Play {
    // Required methods
    fn name(&self) -> &'static str;
    fn start(&self);

    // Provided method
    fn instructions(&self) -> Option<&'static str> { ... }
}
Expand description

The main trait to classify a struct as a playable game.

Required Methods§

Source

fn name(&self) -> &'static str

returns the name of the game

Source

fn start(&self)

start the game. The game state should be exclusively local to this function

Provided Methods§

Source

fn instructions(&self) -> Option<&'static str>

optionally returns the instructions of the game

Implementors§