diff options
Diffstat (limited to 'src/actions.rs')
-rw-r--r-- | src/actions.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/actions.rs b/src/actions.rs index 2291de6..ae1f6ce 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -8,13 +8,13 @@ use std::collections::HashSet; #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] pub enum Action { PlaceShips(Vec<ShipPlacement>), - Shoot(Point) + Shoot(Weapon, Point) } impl fmt::Display for Action { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - &Action::Shoot(p) => writeln!(f, "1,{},{}", p.x, p.y), + &Action::Shoot(w, p) => writeln!(f, "{},{},{}", w, p.x, p.y), &Action::PlaceShips(ref ships) => ships.iter().map(|ref ship| { writeln!(f, "{} {} {} {}", ship.ship_type, ship.point.x, ship.point.y, ship.direction) }).fold(Ok(()), |acc, next| acc.and(next)) |