Changes for Statistic Sets, use a new way for Atomic traits.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::atomic::{AtomicBool, AtomicI8, AtomicU32, AtomicU8, Ordering};
|
||||
use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU8, Ordering};
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
use atomic::Atomic;
|
||||
@@ -67,16 +67,16 @@ where
|
||||
height: Atomic<f32>,
|
||||
|
||||
/// The stats of the Pokemon when disregarding any stat boosts.
|
||||
flat_stats: StatisticSet<AtomicU32>,
|
||||
flat_stats: StatisticSet<u32>,
|
||||
/// The statistics boosts of the Pokemon. Will prevent the value from going above 6, and below
|
||||
/// -6.
|
||||
stat_boost: ClampedStatisticSet<AtomicI8, -6, 6>,
|
||||
stat_boost: ClampedStatisticSet<i8, -6, 6>,
|
||||
/// The stats of the Pokemon including the stat boosts
|
||||
boosted_stats: StatisticSet<AtomicU32>,
|
||||
boosted_stats: StatisticSet<u32>,
|
||||
/// The [individual values](https://bulbapedia.bulbagarden.net/wiki/Individual_values) of the Pokemon.
|
||||
individual_values: ClampedStatisticSet<AtomicU8, 0, 31>,
|
||||
individual_values: ClampedStatisticSet<u8, 0, 31>,
|
||||
/// The [effort values](https://bulbapedia.bulbagarden.net/wiki/Effort_values) of the Pokemon.
|
||||
effort_values: ClampedStatisticSet<AtomicU8, 0, 252>,
|
||||
effort_values: ClampedStatisticSet<u8, 0, 252>,
|
||||
/// The [nature](https://bulbapedia.bulbagarden.net/wiki/Nature) of the Pokemon.
|
||||
nature: &'own Nature,
|
||||
|
||||
@@ -304,11 +304,11 @@ impl<'own, 'library> Pokemon<'own, 'library> {
|
||||
}
|
||||
|
||||
/// The stats of the Pokemon when disregarding any stat boosts.
|
||||
pub fn flat_stats(&self) -> &StatisticSet<AtomicU32> {
|
||||
pub fn flat_stats(&self) -> &StatisticSet<u32> {
|
||||
&self.flat_stats
|
||||
}
|
||||
/// The stats of the Pokemon including the stat boosts
|
||||
pub fn boosted_stats(&self) -> &StatisticSet<AtomicU32> {
|
||||
pub fn boosted_stats(&self) -> &StatisticSet<u32> {
|
||||
&self.boosted_stats
|
||||
}
|
||||
/// Get the stat boosts for a specific stat.
|
||||
@@ -365,11 +365,11 @@ impl<'own, 'library> Pokemon<'own, 'library> {
|
||||
}
|
||||
|
||||
/// The [individual values](https://bulbapedia.bulbagarden.net/wiki/Individual_values) of the Pokemon.
|
||||
pub fn individual_values(&self) -> &ClampedStatisticSet<AtomicU8, 0, 31> {
|
||||
pub fn individual_values(&self) -> &ClampedStatisticSet<u8, 0, 31> {
|
||||
&self.individual_values
|
||||
}
|
||||
/// The [effort values](https://bulbapedia.bulbagarden.net/wiki/Effort_values) of the Pokemon.
|
||||
pub fn effort_values(&self) -> &ClampedStatisticSet<AtomicU8, 0, 252> {
|
||||
pub fn effort_values(&self) -> &ClampedStatisticSet<u8, 0, 252> {
|
||||
&self.effort_values
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user