PkmnLibSharp/PkmnLibSharp/Library/GrowthRates/GrowthRateLibrary.cs

42 lines
1.3 KiB
C#
Raw Normal View History

2020-05-19 12:25:21 +00:00
using System;
2020-05-06 10:39:28 +00:00
using PkmnLibSharp.Utilities;
namespace PkmnLibSharp.Library.GrowthRates
{
public class GrowthRateLibrary : PointerWrapper
{
internal GrowthRateLibrary(IntPtr ptr) : base(ptr)
{
}
2020-05-06 10:39:28 +00:00
public GrowthRateLibrary(ulong initialCapacity) : base(
Creatureliblibrary.Generated.GrowthRateLibrary.Construct(initialCapacity))
{
}
public byte CalculateLevel(string growthRateName, uint experience)
{
byte b = 0;
Creatureliblibrary.Generated.GrowthRateLibrary.CalculateLevel(ref b, Ptr, growthRateName.ToPtr(),
experience).Assert();
return b;
}
public uint CalculateExperience(string growthRateName, byte level)
{
uint i = 0;
Creatureliblibrary.Generated.GrowthRateLibrary.CalculateExperience(ref i, Ptr, growthRateName.ToPtr(),
level).Assert();
return i;
}
public void AddGrowthRate(string name, GrowthRate gr)
{
Creatureliblibrary.Generated.GrowthRateLibrary.AddGrowthRate(Ptr, name.ToPtr(), gr.Ptr).Assert();
}
2020-05-19 12:25:21 +00:00
2020-05-06 10:39:28 +00:00
protected override void DeletePtr()
{
Creatureliblibrary.Generated.GrowthRateLibrary.Destruct(Ptr);
}
}
}