Rename unique_identifier --> personality_value, minor fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-07-09 11:17:43 +02:00
parent bc9b3ed964
commit f6df95a824
8 changed files with 70 additions and 46 deletions

View File

@@ -76,21 +76,24 @@ extern "C" fn pokemon_display_form(handle: FFIHandle<Pokemon>) -> FFIHandle<Arc<
}
/// The level of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Level)
#[no_mangle]
extern "C" fn pokemon_level(handle: FFIHandle<Pokemon>) -> LevelInt {
handle.from_ffi_handle().level()
}
/// The experience of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Experience)
#[no_mangle]
extern "C" fn pokemon_experience(handle: FFIHandle<Pokemon>) -> u32 {
handle.from_ffi_handle().experience()
}
/// The unique identifier of the Pokemon.
/// The personality value of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Personality_value)
#[no_mangle]
extern "C" fn pokemon_unique_identifier(handle: FFIHandle<Pokemon>) -> u32 {
handle.from_ffi_handle().unique_identifier()
extern "C" fn pokemon_personality_value(handle: FFIHandle<Pokemon>) -> u32 {
handle.from_ffi_handle().personality_value()
}
/// The gender of the Pokemon.

View File

@@ -19,10 +19,10 @@ extern "C" fn pokemon_party_at(ptr: FFIHandle<Arc<PokemonParty>>, index: usize)
}
}
/// Gets a Pokemon at an index in the party.
/// Swaps two Pokemon in the party around.
#[no_mangle]
extern "C" fn pokemon_party_switch(ptr: FFIHandle<Arc<PokemonParty>>, a: usize, b: usize) {
ptr.from_ffi_handle().switch(a, b);
extern "C" fn pokemon_party_switch(ptr: FFIHandle<Arc<PokemonParty>>, a: usize, b: usize) -> FFIResult<()> {
ptr.from_ffi_handle().switch(a, b).into()
}
/// Sets the Pokemon at an index to a Pokemon, returning the old Pokemon.