about summary refs log tree commit diff
path: root/src/entities/character.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/entities/character.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 'src/entities/character.rs')
-rw-r--r--src/entities/character.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/entities/character.rs b/src/entities/character.rs
index 360478e8be1c..3e8336b129ff 100644
--- a/src/entities/character.rs
+++ b/src/entities/character.rs
@@ -1,4 +1,5 @@
 use crate::display;
+use crate::entities::item::Item;
 use crate::types::{Position, Speed};
 use std::io::{self, Write};
 
@@ -7,6 +8,7 @@ const DEFAULT_SPEED: Speed = Speed(100);
 entity! {
     pub struct Character {
         pub o_name: Option<String>,
+        pub inventory: Vec<Box<Item>>,
     }
 }
 
@@ -18,6 +20,7 @@ impl Character {
             id: None,
             position: Position { x: 0, y: 0 },
             o_name: None,
+            inventory: Vec::new(),
         }
     }