diff options
Diffstat (limited to 'game/src/main.rs')
| -rw-r--r-- | game/src/main.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/game/src/main.rs b/game/src/main.rs index 569d08a..4d67a52 100644 --- a/game/src/main.rs +++ b/game/src/main.rs @@ -10,9 +10,11 @@ struct Game { } impl Game { - fn new(window: Window) -> Self { - // Initial game state - let dungeon = Dungeon::random(); + fn new(window: Window, seed: Option<u64>) -> Self { + let dungeon = match seed { + Some(s) => Dungeon::new(s), + None => Dungeon::random(), + }; Self { window, dungeon, @@ -86,6 +88,9 @@ struct Args { /// enable verbose logging #[argh(switch, short = 'v')] verbose: bool, + /// set the map seed + #[argh(option)] + seed: Option<u64>, } fn main() -> Result<()> { @@ -96,6 +101,6 @@ fn main() -> Result<()> { .vsync(args.vsync) .verbose(args.verbose) .build()?; - Game::new(window).run(); + Game::new(window, args.seed).run(); Ok(()) } |