pub struct QuestJournal {
pub active: HashMap<QuestId, Quest>,
pub completed: Vec<Quest>,
pub failed: Vec<Quest>,
}Fields§
§active: HashMap<QuestId, Quest>§completed: Vec<Quest>§failed: Vec<Quest>Implementations§
Source§impl QuestJournal
impl QuestJournal
pub fn new() -> Self
pub fn can_accept(&self) -> bool
pub fn add_quest(&mut self, quest: Quest) -> bool
pub fn complete_quest(&mut self, id: QuestId) -> Option<Quest>
pub fn fail_quest(&mut self, id: QuestId) -> Option<Quest>
pub fn abandon_quest(&mut self, id: QuestId) -> Option<Quest>
pub fn update_objective( &mut self, quest_id: QuestId, obj_idx: usize, delta: u32, ) -> Option<bool>
pub fn check_completion(&mut self, quest_id: QuestId) -> bool
pub fn tick(&mut self, dt: f32) -> Vec<QuestId>
pub fn update_kill_objectives( &mut self, enemy_type: &str, ) -> Vec<(QuestId, usize)>
pub fn update_collect_objectives( &mut self, item_id: ItemId, count: u32, ) -> Vec<(QuestId, usize)>
pub fn has_completed(&self, id: QuestId) -> bool
pub fn active_count(&self) -> usize
pub fn get_active(&self, id: QuestId) -> Option<&Quest>
pub fn all_active_sorted(&self) -> Vec<&Quest>
Trait Implementations§
Source§impl Clone for QuestJournal
impl Clone for QuestJournal
Source§fn clone(&self) -> QuestJournal
fn clone(&self) -> QuestJournal
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuestJournal
impl Debug for QuestJournal
Source§impl Default for QuestJournal
impl Default for QuestJournal
Source§fn default() -> QuestJournal
fn default() -> QuestJournal
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QuestJournal
impl RefUnwindSafe for QuestJournal
impl Send for QuestJournal
impl Sync for QuestJournal
impl Unpin for QuestJournal
impl UnsafeUnpin for QuestJournal
impl UnwindSafe for QuestJournal
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
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.