pub struct DialogueTree {
pub id: String,
pub name: String,
pub nodes: HashMap<u64, DialogueNode>,
pub connections: Vec<NodeConnection>,
pub start_node_id: Option<u64>,
pub metadata: DialogueTreeMetadata,
/* private fields */
}Fields§
§id: String§name: String§nodes: HashMap<u64, DialogueNode>§connections: Vec<NodeConnection>§start_node_id: Option<u64>§metadata: DialogueTreeMetadataImplementations§
Source§impl DialogueTree
impl DialogueTree
pub fn new(id: String, name: String) -> Self
pub fn add_node(&mut self, node: DialogueNode) -> u64
pub fn remove_node(&mut self, id: u64)
pub fn connect( &mut self, from: u64, from_port: usize, to: u64, to_port: usize, label: Option<String>, )
pub fn disconnect(&mut self, from: u64, from_port: usize)
pub fn get_outputs(&self, node_id: u64) -> Vec<&NodeConnection>
pub fn get_inputs(&self, node_id: u64) -> Vec<&NodeConnection>
pub fn next_node(&self, from: u64, port: usize) -> Option<u64>
pub fn allocate_id(&mut self) -> u64
pub fn validate(&self) -> Vec<ValidationError>
pub fn find_reachable_nodes(&self, start: u64) -> HashSet<u64>
pub fn topological_sort(&self) -> Vec<u64>
pub fn find_cycles(&self) -> Vec<Vec<u64>>
pub fn collect_all_localization_keys(&self) -> Vec<String>
pub fn collect_all_voice_lines(&self) -> Vec<VoiceLineRef>
pub fn auto_layout(&mut self)
Trait Implementations§
Source§impl Clone for DialogueTree
impl Clone for DialogueTree
Auto Trait Implementations§
impl Freeze for DialogueTree
impl RefUnwindSafe for DialogueTree
impl Send for DialogueTree
impl Sync for DialogueTree
impl Unpin for DialogueTree
impl UnsafeUnpin for DialogueTree
impl UnwindSafe for DialogueTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.