about summary refs log tree commit diff
path: root/src/types/command.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-08-25T17·25-0400
committerGriffin Smith <root@gws.fyi>2019-08-25T17·25-0400
commitfb0d1b3e66251aa56a3df1d05fd4b82b33380a31 (patch)
tree367edbe5f504a3eb8130e5e0a8dd695fbbc65684 /src/types/command.rs
parente2d2f011c6373894b3cdcfbdb98fbc783504561a (diff)
Wipe Rust project
Sorry rust, but you're just not fun to write
Diffstat (limited to 'src/types/command.rs')
-rw-r--r--src/types/command.rs41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/types/command.rs b/src/types/command.rs
deleted file mode 100644
index 17ca4d280fd8..000000000000
--- a/src/types/command.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-use super::Direction;
-use super::Direction::*;
-use termion::event::Key;
-use termion::event::Key::{Char, Ctrl};
-
-pub enum Command {
-    /// Quit the game
-    Quit,
-
-    /// Move the character in a direction
-    Move(Direction),
-
-    /// Pick up any item(s) at the current position
-    PickUp,
-
-    /// Display the previous message
-    PreviousMessage,
-}
-
-impl Command {
-    pub fn from_key(k: Key) -> Option<Command> {
-        use Command::*;
-        match k {
-            Char('q') => Some(Quit),
-
-            Char('h') | Char('a') | Key::Left => Some(Move(Left)),
-            Char('k') | Char('w') | Key::Up => Some(Move(Up)),
-            Char('j') | Char('s') | Key::Down => Some(Move(Down)),
-            Char('l') | Char('d') | Key::Right => Some(Move(Right)),
-            Char('y') => Some(Move(UpLeft)),
-            Char('u') => Some(Move(UpRight)),
-            Char('b') => Some(Move(DownLeft)),
-            Char('n') => Some(Move(DownRight)),
-
-            Ctrl('p') => Some(PreviousMessage),
-            Char(',') => Some(PickUp),
-
-            _ => None,
-        }
-    }
-}