using System;
using PkmnLibSharp.Library;
using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Battling
{
    public class StatCalculator : PointerWrapper
    {
        internal StatCalculator(IntPtr ptr) : base(ptr)
        {
        }

        public StatCalculator() : base(Pkmnlib.Generated.StatCalculator.Construct())
        {
        }

        public uint CalculateFlatStat(Pokemon pokemon, Statistic stat)
        {
            uint val = 0;
            Creaturelib.Generated.BattleStatCalculator
                .CalculateFlatStat(ref val, Ptr, pokemon.Ptr, (Creaturelib.Statistic) stat).Assert();
            return val;
        }

        public uint CalculateBoostedStat(Pokemon pokemon, Statistic stat)
        {
            uint val = 0;
            Creaturelib.Generated.BattleStatCalculator
                .CalculateBoostedStat(ref val, Ptr, pokemon.Ptr, (Creaturelib.Statistic) stat).Assert();
            return val;
        }

        protected override void DeletePtr()
        {
            Pkmnlib.Generated.StatCalculator.Destruct(Ptr);
        }
    }
}