Reworks static library initialiser
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,11 +1,11 @@
|
||||
use crate::static_data::AbilityLibrary;
|
||||
use crate::static_data::GrowthRateLibrary;
|
||||
use crate::static_data::ItemLibrary;
|
||||
use crate::static_data::LibrarySettings;
|
||||
use crate::static_data::MoveLibrary;
|
||||
use crate::static_data::NatureLibrary;
|
||||
use crate::static_data::SpeciesLibrary;
|
||||
use crate::static_data::TypeLibrary;
|
||||
use crate::static_data::{AbilityLibrary, AbilityLibraryImpl, ItemLibraryImpl, MoveLibraryImpl, SpeciesLibraryImpl};
|
||||
use crate::static_data::{GrowthRateLibrary, GrowthRateLibraryImpl};
|
||||
use crate::static_data::{ItemLibrary, NatureLibraryImpl};
|
||||
use crate::static_data::{LibrarySettings, TypeLibraryImpl};
|
||||
use crate::{ValueIdentifiable, ValueIdentifier};
|
||||
use std::fmt::Debug;
|
||||
|
||||
@@ -69,17 +69,26 @@ pub struct StaticDataImpl {
|
||||
|
||||
impl StaticDataImpl {
|
||||
/// Instantiates a new data collection.
|
||||
pub fn new(settings: Box<dyn LibrarySettings>) -> Self {
|
||||
pub fn new(
|
||||
settings: Box<dyn LibrarySettings>,
|
||||
species: Box<dyn SpeciesLibrary>,
|
||||
moves: Box<dyn MoveLibrary>,
|
||||
items: Box<dyn ItemLibrary>,
|
||||
growth_rates: Box<dyn GrowthRateLibrary>,
|
||||
types: Box<dyn TypeLibrary>,
|
||||
natures: Box<dyn NatureLibrary>,
|
||||
abilities: Box<dyn AbilityLibrary>,
|
||||
) -> Self {
|
||||
Self {
|
||||
identifier: Default::default(),
|
||||
settings,
|
||||
species: Box::new(SpeciesLibraryImpl::new(0)),
|
||||
moves: Box::new(MoveLibraryImpl::new(0)),
|
||||
items: Box::new(ItemLibraryImpl::new(0)),
|
||||
growth_rates: Box::new(GrowthRateLibraryImpl::new(0)),
|
||||
types: Box::new(TypeLibraryImpl::new(0)),
|
||||
natures: Box::new(NatureLibraryImpl::new(0)),
|
||||
abilities: Box::new(AbilityLibraryImpl::new(0)),
|
||||
species,
|
||||
moves,
|
||||
items,
|
||||
growth_rates,
|
||||
types,
|
||||
natures,
|
||||
abilities,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user