console_games/
lib.rs

1mod game_center;
2
3pub use game_center::*;
4pub mod games;
5mod util;
6
7/// The main trait to classify a struct as a playable game.
8pub trait Play {
9    /// returns the name of the game
10    fn name(&self) -> &'static str;
11
12    /// optionally returns the instructions of the game
13    fn instructions(&self) -> Option<&'static str> {
14        None
15    }
16
17    /// start the game.
18    /// The game state should be exclusively local to this function
19    fn start(&self);
20}