using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Library.GrowthRates
{
    public class GrowthRateLibrary : PointerWrapper
    {
        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();
        }

        protected override void DeletePtr()
        {
            Creatureliblibrary.Generated.GrowthRateLibrary.Destruct(Ptr);
        }
    }
}