Simplify WASM interface for static_statistic_set
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:
@@ -56,16 +56,22 @@ mod implementation {
|
||||
Self::from_ref(reference, &|reference| Self {
|
||||
inner: Rc::new(ImmutableStatisticSetInner {
|
||||
reference,
|
||||
hp: cached_value!({ static_statistics_set_get_hp(reference) }),
|
||||
attack: cached_value!({ static_statistics_set_get_attack(reference) }),
|
||||
defense: cached_value!({ static_statistics_set_get_defense(reference) }),
|
||||
hp: cached_value!({ static_statistics_set_get_stat(reference, Statistic::HP) }),
|
||||
attack: cached_value!({
|
||||
static_statistics_set_get_stat(reference, Statistic::Attack)
|
||||
}),
|
||||
defense: cached_value!({
|
||||
static_statistics_set_get_stat(reference, Statistic::Defense)
|
||||
}),
|
||||
special_attack: cached_value!({
|
||||
static_statistics_set_get_special_attack(reference)
|
||||
static_statistics_set_get_stat(reference, Statistic::SpecialAttack)
|
||||
}),
|
||||
special_defense: cached_value!({
|
||||
static_statistics_set_get_special_defense(reference)
|
||||
static_statistics_set_get_stat(reference, Statistic::SpecialDefense)
|
||||
}),
|
||||
speed: cached_value!({
|
||||
static_statistics_set_get_stat(reference, Statistic::Speed)
|
||||
}),
|
||||
speed: cached_value!({ static_statistics_set_get_speed(reference) }),
|
||||
}),
|
||||
})
|
||||
}
|
||||
@@ -101,15 +107,10 @@ mod implementation {
|
||||
crate::handling::cacheable::cacheable!(ImmutableStatisticSetImpl);
|
||||
|
||||
extern "wasm" {
|
||||
fn static_statistics_set_get_hp(r: ExternRef<ImmutableStatisticSetImpl>) -> u16;
|
||||
fn static_statistics_set_get_attack(r: ExternRef<ImmutableStatisticSetImpl>) -> u16;
|
||||
fn static_statistics_set_get_defense(r: ExternRef<ImmutableStatisticSetImpl>) -> u16;
|
||||
fn static_statistics_set_get_special_attack(r: ExternRef<ImmutableStatisticSetImpl>)
|
||||
-> u16;
|
||||
fn static_statistics_set_get_special_defense(
|
||||
fn static_statistics_set_get_stat(
|
||||
r: ExternRef<ImmutableStatisticSetImpl>,
|
||||
stat: Statistic,
|
||||
) -> u16;
|
||||
fn static_statistics_set_get_speed(r: ExternRef<ImmutableStatisticSetImpl>) -> u16;
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "mock_data"))]
|
||||
|
||||
Reference in New Issue
Block a user