summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-06-24 21:04:27 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-06-24 21:04:27 +0200
commit1aeab6da05a0c7b7dad4d06a38b282a82d5e1a51 (patch)
treede76a41b53f4ba383bda118dfb97bd2ff53f7a23 /tests
parent6d6cb9e39c4ec3f113833042f1b7bc8082c5d650 (diff)
New command types for select and bombs
Diffstat (limited to 'tests')
-rw-r--r--tests/official-runner-matching.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/official-runner-matching.rs b/tests/official-runner-matching.rs
index 19cfdeb..8a0320f 100644
--- a/tests/official-runner-matching.rs
+++ b/tests/official-runner-matching.rs
@@ -1,6 +1,6 @@
use steam_powered_wyrm::json;
use steam_powered_wyrm::game::*;
-use steam_powered_wyrm::command::Command;
+use steam_powered_wyrm::command::{Command, Action};
use steam_powered_wyrm::geometry::*;
use std::path::Path;
@@ -101,14 +101,14 @@ fn read_move(csv_line: &[String]) -> Command {
match csv_line[1].as_ref() {
"move" => {
let (x, y) = read_xy_pair(&csv_line[2]);
- Command::Move(Point2d::new(x, y))
+ Command::new(Action::Move(Point2d::new(x, y)))
},
"dig" => {
let (x, y) = read_xy_pair(&csv_line[2]);
- Command::Dig(Point2d::new(x, y))
+ Command::new(Action::Dig(Point2d::new(x, y)))
},
"nothing" => {
- Command::DoNothing
+ Command::new(Action::DoNothing)
},
"shoot" => {
use steam_powered_wyrm::geometry::Direction::*;
@@ -124,8 +124,9 @@ fn read_move(csv_line: &[String]) -> Command {
"shoot NW" => NorthWest,
_ => panic!("Unknown shoot direction: {}", csv_line[2])
};
- Command::Shoot(dir)
+ Command::new(Action::Shoot(dir))
},
+ // TODO: Parsing of new commands
x => {
panic!("Unknown command {}", x);
}