using System;
using PkmnLibSharp.Utilities;

namespace PkmnLibSharp.Library
{
    public class Nature : PointerWrapper
    {
        internal Nature(IntPtr ptr) : base(ptr){}
        
        public Nature(Statistic increasedStat, Statistic decreasedStat, float increasedModifier = 1.1f,
            float decreasedModifier = 0.9f) : base(Pkmnlib.Generated.Nature.Construct((Pkmnlib.Statistic) increasedStat,
            (Pkmnlib.Statistic) decreasedStat,
            increasedModifier, decreasedModifier))
        {
        }

        public Nature() : this(Statistic.Health, Statistic.Health, 1f, 1f)
        {
        }

        public float IncreasedModifier => Pkmnlib.Generated.Nature.GetIncreaseModifier(Ptr);
        public float DecreasedModifier => Pkmnlib.Generated.Nature.GetDecreaseModifier(Ptr);
        public Statistic IncreasedStat => (Statistic) Pkmnlib.Generated.Nature.GetIncreasedStat(Ptr);
        public Statistic DecreasedStat => (Statistic) Pkmnlib.Generated.Nature.GetDecreasedStat(Ptr);

        public float GetStatModifier(Statistic stat)
        {
            return Pkmnlib.Generated.Nature.GetStatModifier(Ptr, (Pkmnlib.Statistic) stat);
        }

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