aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/demo.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-12 20:54:00 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-12 20:54:00 +0200
commite69bd14f1d64b0d8b2438a40a069d3647c1edd73 (patch)
treefd16f12c56a9f51716e7908cb7180b892d01edc9 /planetwars-server/src/routes/demo.rs
parent0b9a9f0eaafb68acb7896ade26b9ae4508096d5c (diff)
downloadplanetwars.dev-e69bd14f1d64b0d8b2438a40a069d3647c1edd73.tar.xz
planetwars.dev-e69bd14f1d64b0d8b2438a40a069d3647c1edd73.zip
refactor: delay BotSpec construction in RunMatch
Diffstat (limited to 'planetwars-server/src/routes/demo.rs')
-rw-r--r--planetwars-server/src/routes/demo.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/planetwars-server/src/routes/demo.rs b/planetwars-server/src/routes/demo.rs
index 1a6ae9a..f9929f7 100644
--- a/planetwars-server/src/routes/demo.rs
+++ b/planetwars-server/src/routes/demo.rs
@@ -47,8 +47,14 @@ pub async fn submit_bot(
.expect("could not save bot code");
let mut run_match = RunMatch::from_players(vec![
- MatchPlayer::from_code_bundle_version(&player_bot_version),
- MatchPlayer::from_bot_version(&opponent_bot, &opponent_bot_version),
+ MatchPlayer::BotVersion {
+ bot: None,
+ version: player_bot_version.clone(),
+ },
+ MatchPlayer::BotVersion {
+ bot: Some(opponent_bot.clone()),
+ version: opponent_bot_version.clone(),
+ },
]);
let match_data = run_match
.store_in_database(&conn)