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:
@@ -9,8 +9,24 @@ use std::ptr::drop_in_place;
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn static_data_new(
|
||||
settings: OwnedPtr<Box<dyn LibrarySettings>>,
|
||||
species: OwnedPtr<Box<dyn SpeciesLibrary>>,
|
||||
moves: OwnedPtr<Box<dyn MoveLibrary>>,
|
||||
items: OwnedPtr<Box<dyn ItemLibrary>>,
|
||||
growth_rates: OwnedPtr<Box<dyn GrowthRateLibrary>>,
|
||||
types: OwnedPtr<Box<dyn TypeLibrary>>,
|
||||
natures: OwnedPtr<Box<dyn NatureLibrary>>,
|
||||
abilities: OwnedPtr<Box<dyn AbilityLibrary>>,
|
||||
) -> IdentifiablePointer<Box<dyn StaticData>> {
|
||||
let b: Box<dyn StaticData> = Box::new(StaticDataImpl::new(*Box::from_raw(settings)));
|
||||
let b: Box<dyn StaticData> = Box::new(StaticDataImpl::new(
|
||||
*Box::from_raw(settings),
|
||||
*Box::from_raw(species),
|
||||
*Box::from_raw(moves),
|
||||
*Box::from_raw(items),
|
||||
*Box::from_raw(growth_rates),
|
||||
*Box::from_raw(types),
|
||||
*Box::from_raw(natures),
|
||||
*Box::from_raw(abilities),
|
||||
));
|
||||
b.into()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user