Basic implementation of evolutions
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,8 +1,7 @@
|
||||
use crate::ffi::ffi_handle::{FFIHandle, FromFFIHandle};
|
||||
use crate::ffi::{ffi_handle_arc_dyn_getter, FFIResult, NonOwnedPtrString, OwnedPtrString};
|
||||
use crate::static_data::{
|
||||
EffectParameter, MoveCategory, MoveData, MoveDataImpl, MoveTarget, SecondaryEffect, SecondaryEffectImpl,
|
||||
TypeIdentifier,
|
||||
MoveCategory, MoveData, MoveDataImpl, MoveTarget, Parameter, SecondaryEffect, SecondaryEffectImpl, TypeIdentifier,
|
||||
};
|
||||
use crate::StringKey;
|
||||
use anyhow::anyhow;
|
||||
@@ -100,7 +99,7 @@ unsafe extern "C" fn move_data_has_flag(ptr: FFIHandle<Arc<dyn MoveData>>, flag:
|
||||
unsafe extern "C" fn secondary_effect_new(
|
||||
chance: f32,
|
||||
effect_name: NonOwnedPtrString,
|
||||
parameters: *mut FFIHandle<Arc<EffectParameter>>,
|
||||
parameters: *mut FFIHandle<Arc<Parameter>>,
|
||||
parameters_length: usize,
|
||||
) -> FFIHandle<Box<dyn SecondaryEffect>> {
|
||||
let parameter_slice = std::slice::from_raw_parts(parameters, parameters_length);
|
||||
@@ -148,7 +147,7 @@ unsafe extern "C" fn secondary_effect_parameter_length(ptr: FFIHandle<Arc<dyn Se
|
||||
unsafe extern "C" fn secondary_effect_parameter_get(
|
||||
ptr: FFIHandle<Arc<dyn SecondaryEffect>>,
|
||||
index: usize,
|
||||
) -> FFIHandle<Arc<EffectParameter>> {
|
||||
) -> FFIHandle<Arc<Parameter>> {
|
||||
if let Some(v) = ptr.from_ffi_handle().parameters().get(index) {
|
||||
FFIHandle::get_handle(v.clone().into())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user