diff options
Diffstat (limited to 'tests/official-runner-matching.rs')
-rw-r--r-- | tests/official-runner-matching.rs | 11 |
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); } |