pub struct CooldownTracker {
pub timers: HashMap<SkillId, f32>,
}Fields§
§timers: HashMap<SkillId, f32>Implementations§
Source§impl CooldownTracker
impl CooldownTracker
pub fn new() -> Self
pub fn start(&mut self, skill_id: SkillId, duration: f32)
pub fn remaining(&self, skill_id: SkillId) -> f32
pub fn is_ready(&self, skill_id: SkillId) -> bool
pub fn tick(&mut self, dt: f32)
pub fn reduce(&mut self, skill_id: SkillId, amount: f32)
pub fn reset(&mut self, skill_id: SkillId)
pub fn reset_all(&mut self)
pub fn apply_cdr(&mut self, cdr_percent: f32)
Trait Implementations§
Source§impl Clone for CooldownTracker
impl Clone for CooldownTracker
Source§fn clone(&self) -> CooldownTracker
fn clone(&self) -> CooldownTracker
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 CooldownTracker
impl Debug for CooldownTracker
Source§impl Default for CooldownTracker
impl Default for CooldownTracker
Source§fn default() -> CooldownTracker
fn default() -> CooldownTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CooldownTracker
impl RefUnwindSafe for CooldownTracker
impl Send for CooldownTracker
impl Sync for CooldownTracker
impl Unpin for CooldownTracker
impl UnsafeUnpin for CooldownTracker
impl UnwindSafe for CooldownTracker
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.