pub struct VariableScope {
pub local: HashMap<String, DialogueValue>,
pub global: HashMap<String, DialogueValue>,
pub persistent: HashMap<String, DialogueValue>,
pub change_log: Vec<VariableChange>,
}Fields§
§local: HashMap<String, DialogueValue>§global: HashMap<String, DialogueValue>§persistent: HashMap<String, DialogueValue>§change_log: Vec<VariableChange>Implementations§
Source§impl VariableScope
impl VariableScope
pub fn new() -> Self
pub fn get(&self, name: &str, scope: &ScopeType) -> Option<DialogueValue>
pub fn get_any(&self, name: &str) -> Option<DialogueValue>
pub fn set(&mut self, name: String, scope: ScopeType, value: DialogueValue)
pub fn set_flag(&mut self, name: &str)
pub fn clear_flag(&mut self, name: &str)
pub fn has_flag(&self, name: &str) -> bool
pub fn clear_local(&mut self)
pub fn serialize_persistent(&self) -> String
pub fn deserialize_persistent(&mut self, data: &str)
pub fn get_all_vars(&self) -> Vec<(String, ScopeType, &DialogueValue)>
Trait Implementations§
Source§impl Clone for VariableScope
impl Clone for VariableScope
Source§impl Debug for VariableScope
impl Debug for VariableScope
Auto Trait Implementations§
impl Freeze for VariableScope
impl RefUnwindSafe for VariableScope
impl Send for VariableScope
impl Sync for VariableScope
impl Unpin for VariableScope
impl UnsafeUnpin for VariableScope
impl UnwindSafe for VariableScope
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.