From 19ce5319e2250b7b0e1a188f69d24de282a85a7f Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 3 Feb 2020 16:36:52 +0100 Subject: merged Draw into View; renamed Position to Pos --- src/controls.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/controls.rs') diff --git a/src/controls.rs b/src/controls.rs index 5cf6d4f..ae806a9 100644 --- a/src/controls.rs +++ b/src/controls.rs @@ -1,7 +1,7 @@ use serde_json::Value; -use super::components::Position; +use super::components::Pos; #[derive(Debug, Clone)] pub enum Direction { @@ -28,13 +28,13 @@ impl Direction { } } - pub fn to_position(&self) -> Position { + pub fn to_position(&self) -> Pos { match self { - Direction::North => Position::new(0, -1), - Direction::South => Position::new(0, 1), - Direction::East => Position::new(1, 0), - Direction::West => Position::new(-1, 0), - Direction::None => Position::new(0, 0) + Direction::North => Pos::new(0, -1), + Direction::South => Pos::new(0, 1), + Direction::East => Pos::new(1, 0), + Direction::West => Pos::new(-1, 0), + Direction::None => Pos::new(0, 0) } } } -- cgit