1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod 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", self.name());
    }

    /// start the game and should return when the game ends
    fn start(&mut self);
}