Support for getting a species by ID

This commit is contained in:
Deukhoofd 2020-08-22 13:33:39 +02:00
parent 2c931bd32c
commit 8080e921bc
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 11 additions and 0 deletions

View File

@ -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);