aboutsummaryrefslogtreecommitdiff
path: root/planetwars-cli/src/commands/run_match.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-01 12:10:02 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-01 12:10:02 +0100
commit4a077c7c65eced447c45389acf05007dd571bf26 (patch)
treef291c61c6164a58fb1d3ab66952d07d0b7e4609c /planetwars-cli/src/commands/run_match.rs
parente145947d052450618af3ba094e66a27c3c7f86e4 (diff)
downloadplanetwars.dev-4a077c7c65eced447c45389acf05007dd571bf26.tar.xz
planetwars.dev-4a077c7c65eced447c45389acf05007dd571bf26.zip
extract matchrunner crate from planetwars-cli
Diffstat (limited to 'planetwars-cli/src/commands/run_match.rs')
-rw-r--r--planetwars-cli/src/commands/run_match.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/planetwars-cli/src/commands/run_match.rs b/planetwars-cli/src/commands/run_match.rs
index 868e87c..03868ae 100644
--- a/planetwars-cli/src/commands/run_match.rs
+++ b/planetwars-cli/src/commands/run_match.rs
@@ -1,9 +1,8 @@
use std::io;
use clap::Parser;
+use planetwars_matchrunner::{run_match, MatchConfig, MatchPlayer};
-use crate::match_runner::MatchConfig;
-use crate::match_runner::{self, MatchPlayer};
use crate::workspace::Workspace;
#[derive(Parser)]
pub struct RunMatchCommand {
@@ -26,7 +25,8 @@ impl RunMatchCommand {
let bot = workspace.get_bot(&bot_name)?;
players.push(MatchPlayer {
name: bot_name.clone(),
- bot,
+ path: bot.path.clone(),
+ argv: bot.config.get_run_argv(),
});
}
@@ -37,7 +37,7 @@ impl RunMatchCommand {
players,
};
- match_runner::run_match(match_config).await;
+ run_match(match_config).await;
println!("match completed successfully");
// TODO: maybe print the match result as well?