pub struct AchievementManager {
pub achievements: Vec<Achievement>,
pub notify_queue: VecDeque<Achievement>,
pub active_notifications: Vec<AchievementNotification>,
/* private fields */
}Fields§
§achievements: Vec<Achievement>§notify_queue: VecDeque<Achievement>§active_notifications: Vec<AchievementNotification>Implementations§
Source§impl AchievementManager
impl AchievementManager
pub fn new() -> Self
pub fn with_achievements(achievements: Vec<Achievement>) -> Self
pub fn check_all(&mut self, stats: &SessionStats)
pub fn unlock(&mut self, id: &str)
pub fn progress(&mut self, id: &str, delta: i64)
pub fn is_unlocked(&self, id: &str) -> bool
pub fn completion_percent(&self) -> f32
pub fn points(&self) -> u32
pub fn total_possible_points(&self) -> u32
pub fn update(&mut self, dt: f32)
pub fn by_category(&self, category: AchievementCategory) -> Vec<&Achievement>
pub fn unlocked_achievements(&self) -> Vec<&Achievement>
pub fn locked_achievements(&self) -> Vec<&Achievement>
pub fn record_win(&mut self)
pub fn record_loss(&mut self)
pub fn record_enemy_kill(&mut self, enemy_type: &str)
pub fn set_gold(&mut self, amount: u64)
pub fn achievement_by_id(&self, id: &str) -> Option<&Achievement>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AchievementManager
impl RefUnwindSafe for AchievementManager
impl Send for AchievementManager
impl Sync for AchievementManager
impl Unpin for AchievementManager
impl UnsafeUnpin for AchievementManager
impl UnwindSafe for AchievementManager
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> 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.