Move Form and Species to traits, implement a bunch of mocks
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:
@@ -16,10 +16,10 @@ use pkmn_lib::dynamic_data::Gen7DamageLibrary;
|
||||
use pkmn_lib::dynamic_data::Gen7MiscLibrary;
|
||||
use pkmn_lib::script_implementations::wasm::script_resolver::WebAssemblyScriptResolver;
|
||||
use pkmn_lib::static_data::{
|
||||
AbilityImpl, AbilityLibrary, BattleItemCategory, DataLibrary, EffectParameter, Form, GrowthRateLibrary, ItemImpl,
|
||||
ItemLibrary, LearnableMoves, LearnableMovesImpl, LibrarySettings, LookupGrowthRate, MoveDataImpl, MoveLibrary,
|
||||
NatureImpl, NatureLibrary, SecondaryEffect, SecondaryEffectImpl, Species, StaticData, StaticStatisticSet,
|
||||
Statistic, TypeLibrary,
|
||||
AbilityImpl, AbilityLibrary, BattleItemCategory, DataLibrary, EffectParameter, Form, FormImpl, GrowthRateLibrary,
|
||||
ItemImpl, ItemLibrary, LearnableMoves, LearnableMovesImpl, LibrarySettings, LookupGrowthRate, MoveDataImpl,
|
||||
MoveLibrary, NatureImpl, NatureLibrary, SecondaryEffect, SecondaryEffectImpl, SpeciesImpl, StaticData,
|
||||
StaticStatisticSet, Statistic, TypeLibrary,
|
||||
};
|
||||
use pkmn_lib::StringKey;
|
||||
|
||||
@@ -263,7 +263,7 @@ pub fn load_species(path: &String, library: &mut StaticData) {
|
||||
let default_form_value = forms.get("default").unwrap();
|
||||
let default_form = parse_form("default".into(), default_form_value, library);
|
||||
|
||||
let species = Species::new(
|
||||
let species = SpeciesImpl::new(
|
||||
id as u16,
|
||||
&name,
|
||||
gender_rate as f32,
|
||||
@@ -285,7 +285,7 @@ fn load_wasm(path: &String, library: &mut WebAssemblyScriptResolver) {
|
||||
library.finalize();
|
||||
}
|
||||
|
||||
fn parse_form(name: StringKey, value: &Value, library: &mut StaticData) -> Arc<Form> {
|
||||
fn parse_form(name: StringKey, value: &Value, library: &mut StaticData) -> Arc<dyn Form> {
|
||||
let mut abilities = Vec::new();
|
||||
for a in value.get("abilities").unwrap().as_array().unwrap() {
|
||||
abilities.push(a.as_str().unwrap().into());
|
||||
@@ -310,7 +310,7 @@ fn parse_form(name: StringKey, value: &Value, library: &mut StaticData) -> Arc<F
|
||||
|
||||
let moves = parse_moves(value.get("moves").unwrap(), library.moves());
|
||||
|
||||
Arc::new(Form::new(
|
||||
Arc::new(FormImpl::new(
|
||||
&name,
|
||||
height as f32,
|
||||
weight as f32,
|
||||
|
||||
Reference in New Issue
Block a user