Trait console_games::Play

source ·
pub trait Play {
    fn name(&self) -> &'static str;
    fn start(&self);

    fn print_intro(&self) { ... }
}
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 print_intro(&self)

print the game’s intro or description before the game starts

Implementors§