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

This commit is contained in:
2022-11-27 22:29:11 +01:00
parent 27164616e9
commit ad9f17ccf1
12 changed files with 118 additions and 81 deletions

View File

@@ -6,7 +6,7 @@ use hashbrown::HashSet;
use crate::dynamic_data::choices::{MoveChoice, TurnChoice};
use crate::dynamic_data::Pokemon;
use crate::dynamic_data::{LearnedMove, MoveLearnMethod};
use crate::static_data::{MoveCategory, MoveData, MoveTarget, SecondaryEffectImpl};
use crate::static_data::{MoveCategory, MoveData, MoveDataImpl, MoveTarget, SecondaryEffectImpl};
use crate::{StringKey, ValueIdentifiable, ValueIdentifier};
/// The misc library holds several misc functions required for the battle to run.
@@ -31,7 +31,7 @@ pub struct Gen7MiscLibrary {
impl Gen7MiscLibrary {
/// Instantiates a new MiscLibrary.
pub fn new() -> Self {
let struggle_data = Arc::new(MoveData::new(
let struggle_data: Arc<dyn MoveData> = Arc::new(MoveDataImpl::new(
&StringKey::new("struggle"),
0.into(),
MoveCategory::Physical,