diff options
Diffstat (limited to 'src/components/interactable.rs')
| -rw-r--r-- | src/components/interactable.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/interactable.rs b/src/components/interactable.rs index 1787a33..3432f33 100644 --- a/src/components/interactable.rs +++ b/src/components/interactable.rs @@ -8,7 +8,8 @@ use specs::{ use crate::{ exchange::Exchange, ItemId, - components::Trigger + components::Trigger, + RoomId }; #[derive(Component, Debug, Clone, PartialEq)] @@ -17,7 +18,8 @@ pub enum Interactable { Trigger(Trigger), Say(String), Reply(String), - Exchange(String, HashMap<String, Exchange>) + Exchange(String, HashMap<String, Exchange>), + Visit(RoomId) } use Interactable::*; @@ -44,6 +46,7 @@ impl Interactable { }) .collect::<Option<HashMap<String, Exchange>>>()? ), + "visit" => Visit(RoomId::from_str(arg.as_str()?)), _ => None? }) } @@ -60,6 +63,13 @@ impl Interactable { true } } + Visit(_) => { + if let Some(txt) = arg { + txt.starts_with("visit") + } else { + false + } + } } } } |
