Trait yarn_spool::YarnHandler [−][src]
pub trait YarnHandler { fn say(&mut self, text: String); fn choose(&mut self, text: String, choices: Vec<String>); fn command(&mut self, action: String) -> Result<(), ()>; fn end_conversation(&mut self); }
A handler for Yarn actions that require integration with the embedder. Invoked synchronously during Yarn execution when matching steps are evaluated.
Required Methods
fn say(&mut self, text: String)
Present a line of dialogue without any choices. Execution will not
resume until YarnEngine::proceed
is invoked.
fn choose(&mut self, text: String, choices: Vec<String>)
Present a line of dialogue with subsequent choices. Execution will not
resume until YarnEngine::choose
is invoked.
fn command(&mut self, action: String) -> Result<(), ()>
Instruct the embedder to perform some kind of action. The given action string is passed unmodified from the node source.
fn end_conversation(&mut self)
End the current conversation. Execution will not resume until a new
node is made active with YarnEngine::activate
.