pub struct QuestStateStore {
pub quest_instances: HashMap<String, QuestInstance>,
pub faction_reps: HashMap<String, i32>,
pub player_level: u32,
pub player_stats: HashMap<String, f32>,
pub flags: HashSet<String>,
pub item_inventory: HashMap<String, u32>,
pub event_times: HashMap<String, f64>,
pub chain_completions: HashMap<String, f64>,
pub current_time: f64,
}Fields§
§quest_instances: HashMap<String, QuestInstance>§faction_reps: HashMap<String, i32>§player_level: u32§player_stats: HashMap<String, f32>§flags: HashSet<String>§item_inventory: HashMap<String, u32>§event_times: HashMap<String, f64>§chain_completions: HashMap<String, f64>§current_time: f64Implementations§
Source§impl QuestStateStore
impl QuestStateStore
pub fn new() -> Self
pub fn get_quest_state(&self, quest_id: &str) -> QuestState
pub fn start_quest(&mut self, quest_id: &str) -> Result<(), String>
pub fn complete_quest(&mut self, quest_id: &str) -> Result<(), String>
pub fn fail_quest(&mut self, quest_id: &str) -> Result<(), String>
pub fn get_faction_rep(&self, faction_id: &str) -> i32
pub fn modify_faction_rep(&mut self, faction_id: &str, delta: i32)
pub fn get_flag(&self, name: &str) -> bool
pub fn set_flag(&mut self, name: &str)
pub fn clear_flag(&mut self, name: &str)
pub fn get_item_count(&self, item_id: &str) -> u32
pub fn add_item(&mut self, item_id: &str, quantity: u32)
pub fn get_player_stat(&self, stat: &str) -> f32
pub fn get_time_since(&self, event: &str) -> f32
pub fn record_event(&mut self, event: &str)
pub fn is_objective_complete(&self, quest_id: &str, obj_id: &str) -> bool
pub fn get_chain_last_completion(&self, chain_id: &str) -> f32
pub fn get_active_quests(&self) -> Vec<&QuestInstance>
pub fn get_completed_quests(&self) -> Vec<&QuestInstance>
Trait Implementations§
Source§impl Clone for QuestStateStore
impl Clone for QuestStateStore
Auto Trait Implementations§
impl Freeze for QuestStateStore
impl RefUnwindSafe for QuestStateStore
impl Send for QuestStateStore
impl Sync for QuestStateStore
impl Unpin for QuestStateStore
impl UnsafeUnpin for QuestStateStore
impl UnwindSafe for QuestStateStore
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.