summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/interactable.rs16
-rw-r--r--src/components/mod.rs2
2 files changed, 9 insertions, 9 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)]
diff --git a/src/components/mod.rs b/src/components/mod.rs
index 68e666c..f315060 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -16,7 +16,7 @@ pub use messages::{
TriggerBox
};
pub use faction::Faction;
-pub use interactable::{Interactable, Talkable, Exchanger};
+pub use interactable::{Interactable, Exchanger};
pub use equipment::Equipment;
pub use inventory::Inventory;
pub use serialise::Serialise;