pub struct RepeatableQuestTracker {
pub quest_id: String,
pub completion_count: u32,
pub last_completion_time: f64,
pub cooldown_secs: f64,
pub max_completions: Option<u32>,
pub rewards_scale_with_completions: bool,
pub reward_scale_factor: f32,
pub reward_cap_multiplier: f32,
}Fields§
§quest_id: String§completion_count: u32§last_completion_time: f64§cooldown_secs: f64§max_completions: Option<u32>§rewards_scale_with_completions: bool§reward_scale_factor: f32§reward_cap_multiplier: f32Implementations§
Source§impl RepeatableQuestTracker
impl RepeatableQuestTracker
pub fn new(quest_id: &str, cooldown: f64) -> Self
pub fn can_start(&self, current_time: f64) -> bool
pub fn complete(&mut self, current_time: f64)
pub fn get_reward_multiplier(&self) -> f32
pub fn cooldown_remaining(&self, current_time: f64) -> f64
pub fn format_cooldown(&self, current_time: f64) -> String
Trait Implementations§
Source§impl Clone for RepeatableQuestTracker
impl Clone for RepeatableQuestTracker
Auto Trait Implementations§
impl Freeze for RepeatableQuestTracker
impl RefUnwindSafe for RepeatableQuestTracker
impl Send for RepeatableQuestTracker
impl Sync for RepeatableQuestTracker
impl Unpin for RepeatableQuestTracker
impl UnsafeUnpin for RepeatableQuestTracker
impl UnwindSafe for RepeatableQuestTracker
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.