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:
@@ -63,7 +63,7 @@ register! {
|
||||
fn pokemon_get_species(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
pokemon: ExternRef<Pokemon>,
|
||||
) -> ExternRef<Species> {
|
||||
) -> ExternRef<dyn Species> {
|
||||
let species = pokemon.value_func(&env).unwrap().species();
|
||||
ExternRef::func_new(&env, &species)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ fn species_library_get_species(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
lib: ExternRef<SpeciesLibrary>,
|
||||
string_key: ExternRef<StringKey>,
|
||||
) -> ExternRef<Species> {
|
||||
) -> ExternRef<dyn Species> {
|
||||
let lib = lib.value_func(&env).unwrap();
|
||||
let m = lib.get(string_key.value_func(&env).unwrap());
|
||||
if let Some(v) = m {
|
||||
@@ -23,39 +23,39 @@ fn species_library_get_species(
|
||||
|
||||
fn species_get_capture_rate(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
species: ExternRef<Species>,
|
||||
species: ExternRef<dyn Species>,
|
||||
) -> u8 {
|
||||
species.value_func(&env).unwrap().capture_rate()
|
||||
species.value_func_arc(&env).unwrap().capture_rate()
|
||||
}
|
||||
|
||||
fn species_get_growth_rate(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
species: ExternRef<Species>,
|
||||
species: ExternRef<dyn Species>,
|
||||
) -> ExternRef<StringKey> {
|
||||
let species = species.value_func(&env).unwrap();
|
||||
let species = species.value_func_arc(&env).unwrap();
|
||||
ExternRef::func_new(&env, species.growth_rate())
|
||||
}
|
||||
|
||||
fn species_get_gender_rate(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
species: ExternRef<Species>,
|
||||
species: ExternRef<dyn Species>,
|
||||
) -> f32 {
|
||||
species.value_func(&env).unwrap().gender_rate()
|
||||
species.value_func_arc(&env).unwrap().gender_rate()
|
||||
}
|
||||
|
||||
fn species_get_name(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
species: ExternRef<Species>,
|
||||
species: ExternRef<dyn Species>,
|
||||
) -> ExternRef<StringKey> {
|
||||
let species = species.value_func(&env).unwrap();
|
||||
let species = species.value_func_arc(&env).unwrap();
|
||||
ExternRef::func_new(&env, species.name())
|
||||
}
|
||||
|
||||
fn species_get_id(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
species: ExternRef<Species>,
|
||||
species: ExternRef<dyn Species>,
|
||||
) -> u16 {
|
||||
species.value_func(&env).unwrap().id()
|
||||
species.value_func_arc(&env).unwrap().id()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user