Make Nature a trait
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-11-27 17:36:42 +01:00
parent efd1acdfa5
commit 996a35ffa4
7 changed files with 56 additions and 33 deletions

View File

@@ -77,7 +77,7 @@ pub struct Pokemon {
/// The [effort values](https://bulbapedia.bulbagarden.net/wiki/Effort_values) of the Pokemon.
effort_values: ClampedStatisticSet<u8, 0, 252>,
/// The [nature](https://bulbapedia.bulbagarden.net/wiki/Nature) of the Pokemon.
nature: Arc<Nature>,
nature: Arc<dyn Nature>,
/// An optional nickname of the Pokemon.
nickname: Option<String>,
@@ -443,7 +443,7 @@ impl Pokemon {
}
/// The [nature](https://bulbapedia.bulbagarden.net/wiki/Nature) of the Pokemon.
pub fn nature(&self) -> &Arc<Nature> {
pub fn nature(&self) -> &Arc<dyn Nature> {
&self.nature
}