Trait console_games::Play

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

    fn print_intro(&self) { ... }
}
Expand description

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

Required Methods§

returns the name of the game

start the game and should return when the game ends

Provided Methods§

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

Implementors§