feat: bots : quit on match end
This commit is contained in:
parent
6478f5043d
commit
33e77ff095
|
|
@ -38,9 +38,10 @@ impl App {
|
||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let schools_enabled = false;
|
let schools_enabled = false;
|
||||||
|
let should_quit = bot_strategies.len() > 1;
|
||||||
Self {
|
Self {
|
||||||
game: GameRunner::new(schools_enabled, bot_strategies, args.seed.map(|s| s as u64)),
|
game: GameRunner::new(schools_enabled, bot_strategies, args.seed.map(|s| s as u64)),
|
||||||
should_quit: false,
|
should_quit,
|
||||||
schools_enabled,
|
schools_enabled,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ impl GameRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(winner) = self.state.determine_winner() {
|
if let Some(winner) = self.state.determine_winner() {
|
||||||
// panic!("WE HAVE A WINNER!");
|
|
||||||
next_event = Some(store::GameEvent::EndGame {
|
next_event = Some(store::GameEvent::EndGame {
|
||||||
reason: store::EndGameReason::PlayerWon { winner },
|
reason: store::EndGameReason::PlayerWon { winner },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
// Create an application.
|
// Create an application.
|
||||||
let mut app = App::new(args);
|
let mut app = App::new(args);
|
||||||
|
if app.should_quit {
|
||||||
|
println!("{}", app.display());
|
||||||
|
}
|
||||||
|
|
||||||
// Start the main loop.
|
// Start the main loop.
|
||||||
while !app.should_quit {
|
while !app.should_quit {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue