1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
mod game_center;
use console::style;
pub use game_center::*;
pub mod games;
mod util;

/// The main trait to classify a struct as a playable game.
pub trait Play {
    /// returns the name of the game
    fn name(&self) -> &'static str;

    /// print the game's intro or description before the game starts
    fn print_intro(&self) {
        println!("Welcome to {}!\n", style(self.name()).green());
    }

    /// start the game.
    /// The game state should be exclusively local to this function
    fn start(&self);
}