diff options
Diffstat (limited to 'src/components/interactable.rs')
| -rw-r--r-- | src/components/interactable.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/components/interactable.rs b/src/components/interactable.rs index ec8c1db..2e286cf 100644 --- a/src/components/interactable.rs +++ b/src/components/interactable.rs @@ -16,7 +16,9 @@ use crate::{ pub enum Interactable { Trigger(Trigger), Visit(RoomId), - Mine(Stat) + Mine(Stat), + Say(String), + Reply(String) } use Interactable::*; @@ -28,6 +30,8 @@ impl Interactable { ("trigger", Parameter::String(s)) => Trigger(Trigger::from_str(s)?), ("visit", Parameter::String(s)) => Visit(RoomId::from_str(s)), ("mine", Parameter::String(s)) => Mine(Stat::from_str(s)?), + ("say", Parameter::String(s)) => Say(s.clone()), + ("reply", Parameter::String(s)) => Reply(s.clone()), _ => None? }) } @@ -42,17 +46,13 @@ impl Interactable { true } } - Mine(_) => arg.is_none() + Mine(_) => arg.is_none(), + Say(_) => arg.is_none(), + Reply(_) => arg.is_some(), } } } -#[derive(Component, Debug, Clone, PartialEq)] -#[storage(HashMapStorage)] -pub struct Talkable { - pub text: String -} - #[derive(Component, Debug, Clone, PartialEq)] #[storage(HashMapStorage)] |
