Many fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user