Support for getting a species by ID
This commit is contained in:
parent
2c931bd32c
commit
8080e921bc
|
@ -54,6 +54,17 @@ namespace PkmnLibSharp.Library
|
|||
return species;
|
||||
}
|
||||
|
||||
public Species GetById(ushort id)
|
||||
{
|
||||
var ptr = Creaturelib.Generated.SpeciesLibrary.GetById(Ptr, id);
|
||||
if (TryResolvePointer(ptr, out Species? s))
|
||||
{
|
||||
return s!;
|
||||
}
|
||||
s = new Species(ptr);
|
||||
return s;
|
||||
}
|
||||
|
||||
public Species? FindPreEvolution(Species species)
|
||||
{
|
||||
var ptr = Pkmnlib.Generated.SpeciesLibrary.FindPreEvolution(Ptr, species.Ptr);
|
||||
|
|
Loading…
Reference in New Issue