From 755ae8512bfe3ff39a55c22a958e15399e886c5f Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 30 Dec 2021 21:20:46 +0100 Subject: entities can now have descriptions --- src/components/ear.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/components/ear.rs') diff --git a/src/components/ear.rs b/src/components/ear.rs index 6b723b0..6e832aa 100644 --- a/src/components/ear.rs +++ b/src/components/ear.rs @@ -40,6 +40,10 @@ pub enum Notification { Options { description: String, options: Vec<(String, String)> + }, + Describe{ + name: String, + description: String } } @@ -59,7 +63,8 @@ impl Notification { }, Kill{actor: _, target: _} => "kill", Die{actor: _, target: _} => "die", - Options{description: _, options: _} => "options" + Options{description: _, options: _} => "options", + Describe{name: _, description: _} => "describe", }).to_string() } @@ -91,6 +96,10 @@ impl Notification { Options{description, options} => {( format!("{}. Options: {}", description, options.iter().map(|(command, desc)| format!("'{}': {};", command, desc)).collect::>().join(" ")), json!({"description": description.clone(), "options": options.clone()}) + )}, + Describe{name, description} => {( + format!("{} - {}", name, description), + json!({"description": description.clone(), "name": name.clone()}) )} }; (self.type_name(), body, payload) -- cgit