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-03T19·59-0400
committerGriffin Smith <root@gws.fyi>2019-08-04T00·31-0400
commit48fb3f6624b95e9b18a5ff0a814573445c6bc2ab (patch)
tree441a8f04c3e64fd8e3559bab85bab8e0b45789ff /src/types/command.rs
parent82cefedab9e44b48f4d3cc08b0f6e002ae383c9d (diff)
Add inventory, and the ability to pick up items
Add inventory as a basic vector of items attached to the character, and
the ability to pick up a single item where the character stands
Diffstat (limited to '')
-rw-r--r--src/types/command.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/types/command.rs b/src/types/command.rs
index 15017cde99..17ca4d280f 100644
--- a/src/types/command.rs
+++ b/src/types/command.rs
@@ -10,6 +10,9 @@ pub enum Command {
     /// Move the character in a direction
     Move(Direction),
 
+    /// Pick up any item(s) at the current position
+    PickUp,
+
     /// Display the previous message
     PreviousMessage,
 }
@@ -19,6 +22,7 @@ impl 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)),
@@ -29,6 +33,8 @@ impl Command {
             Char('n') => Some(Move(DownRight)),
 
             Ctrl('p') => Some(PreviousMessage),
+            Char(',') => Some(PickUp),
+
             _ => None,
         }
     }