Fixes for SpeciesLibrary
This commit is contained in:
parent
26566a284b
commit
ecea85c26a
|
@ -6,11 +6,17 @@ namespace Pkmnlib.Generated
|
|||
{
|
||||
internal static class SpeciesLibrary
|
||||
{
|
||||
/// <param name="initialCapacity">long unsigned int</param>
|
||||
/// <returns>const SpeciesLibrary *</returns>
|
||||
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_SpeciesLibrary_Construct")]
|
||||
internal static extern IntPtr Construct(ulong initialCapacity);
|
||||
|
||||
/// <param name="out">const PokemonSpecies * &</param>
|
||||
/// <param name="p">const SpeciesLibrary *</param>
|
||||
/// <param name="species">const PokemonSpecies *</param>
|
||||
/// <returns>const PokemonSpecies *</returns>
|
||||
/// <returns>unsigned char</returns>
|
||||
[DllImport("libpkmnLib", CallingConvention = CallingConvention.Cdecl, EntryPoint= "PkmnLib_SpeciesLibrary_FindPreEvolution")]
|
||||
internal static extern IntPtr FindPreEvolution(IntPtr p, IntPtr species);
|
||||
internal static extern byte FindPreEvolution(ref IntPtr @out, IntPtr p, IntPtr species);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,11 +67,12 @@ namespace PkmnLibSharp.Library
|
|||
|
||||
public Species? FindPreEvolution(Species species)
|
||||
{
|
||||
var ptr = Pkmnlib.Generated.SpeciesLibrary.FindPreEvolution(Ptr, species.Ptr);
|
||||
if (ptr == IntPtr.Zero) return null;
|
||||
return TryResolvePointer(ptr, out Species? prevoSpecies)
|
||||
var outPtr = IntPtr.Zero;
|
||||
Pkmnlib.Generated.SpeciesLibrary.FindPreEvolution(ref outPtr, Ptr, species.Ptr).Assert();
|
||||
if (outPtr == IntPtr.Zero) return null;
|
||||
return TryResolvePointer(outPtr, out Species? prevoSpecies)
|
||||
? prevoSpecies
|
||||
: Constructor.Active.ConstructSpecies(ptr);
|
||||
: Constructor.Active.ConstructSpecies(outPtr);
|
||||
}
|
||||
|
||||
public IEnumerable<Species> GetEnumerator()
|
||||
|
@ -93,7 +94,7 @@ namespace PkmnLibSharp.Library
|
|||
}
|
||||
|
||||
public SpeciesLibrary(ulong initialCapacity) : base(
|
||||
Creaturelib.Generated.SpeciesLibrary.Construct(initialCapacity))
|
||||
Pkmnlib.Generated.SpeciesLibrary.Construct(initialCapacity))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so (Stored with Git LFS)
BIN
PkmnLibSharp/Native/Linux/libpkmnLib.so (Stored with Git LFS)
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue