Make LearnableMoves a trait
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:
@@ -30,7 +30,7 @@ pub struct Form {
|
||||
/// The possible hidden abilities a Pokemon with this form can have.
|
||||
hidden_abilities: Vec<StringKey>,
|
||||
/// The moves a Pokemon with this form can learn.
|
||||
moves: LearnableMoves,
|
||||
moves: Box<dyn LearnableMoves>,
|
||||
/// Arbitrary flags can be set on a form for scripting use.
|
||||
flags: HashSet<StringKey>,
|
||||
}
|
||||
@@ -46,7 +46,7 @@ impl Form {
|
||||
base_stats: StaticStatisticSet<u16>,
|
||||
abilities: Vec<StringKey>,
|
||||
hidden_abilities: Vec<StringKey>,
|
||||
moves: LearnableMoves,
|
||||
moves: Box<dyn LearnableMoves>,
|
||||
flags: HashSet<StringKey>,
|
||||
) -> Form {
|
||||
Form {
|
||||
@@ -96,8 +96,10 @@ impl Form {
|
||||
pub fn hidden_abilities(&self) -> &Vec<StringKey> {
|
||||
&self.hidden_abilities
|
||||
}
|
||||
|
||||
#[allow(clippy::borrowed_box)]
|
||||
/// The moves a Pokemon with this form can learn.
|
||||
pub fn moves(&self) -> &LearnableMoves {
|
||||
pub fn moves(&self) -> &Box<dyn LearnableMoves> {
|
||||
&self.moves
|
||||
}
|
||||
/// Arbitrary flags can be set on a form for scripting use.
|
||||
|
||||
Reference in New Issue
Block a user