Many fixes

This commit is contained in:
Deukhoofd committed 2020-05-03 16:26:14 +02:00
1 parent 640451e6d5
commit 8ce1db668e
8 files changed
+42 -1827

No files matched your search

+12 -4
View File
@@ -1,3 +1,4 @@
using System;
using Pkmnlib.Generated;
using PkmnLibSharp.Utilities;
@@ -6,15 +7,22 @@ namespace PkmnLibSharp.Library
public class Species : PointerWrapper
{
// ReSharper disable once SuggestBaseTypeForParameter
public Species(ushort id, string name, Forme defaultForme, float genderRatio, string growthRate,
byte captureRate, byte baseHappiness) : base(PokemonSpecies.Construct(id, name.ToPtr(), defaultForme.Ptr, genderRatio,
growthRate.ToPtr(), captureRate, baseHappiness))
private Species(IntPtr ptr) : base(ptr)
{
}
public static Species Create(ushort id, string name, Forme defaultForme, float genderRatio, string growthRate,
byte captureRate, byte baseHappiness)
{
var ptr = IntPtr.Zero;
PokemonSpecies.Construct(ref ptr, id, name.ToPtr(), defaultForme.Ptr, genderRatio,
growthRate.ToPtr(), captureRate, baseHappiness).Assert();
return new Species(ptr);
}
internal override void DeletePtr()
{
Pokemon.Destruct(Ptr);
PokemonSpecies.Destruct(Ptr);
}
}
}