namespace PkmnLibSharp.Utilities
{
    public class Random : PointerWrapper
    {
        public Random() : base(Arbutils.Generated.Random.Construct())
        {
        }

        public Random(ulong seed) : base(Arbutils.Generated.Random.ConstructWithSeed(seed))
        {
        }

        public float GetFloat()
        {
            return Arbutils.Generated.Random.GetFloat(Ptr);
        }

        public double GetDouble()
        {
            return Arbutils.Generated.Random.GetDouble(Ptr);
        }

        public int Get()
        {
            return Arbutils.Generated.Random.Get(Ptr);
        }

        public int Get(int max)
        {
            int val = 0;
            Arbutils.Generated.Random.GetWithMax(Ptr, max, ref val).Assert();
            return val;
        }

        public int Get(int min, int max)
        {
            int val = 0;
            Arbutils.Generated.Random.GetInLimits(Ptr, min, max, ref val).Assert();
            return val;
        }

        public uint GetUnsigned()
        {
            return Arbutils.Generated.Random.GetUnsigned(Ptr);
        }

        public uint GetUnsigned(uint max)
        {
            uint val = 0;
            Arbutils.Generated.Random.GetUnsignedWithMax(Ptr, max, ref val).Assert();
            return val;
        }

        public uint GetUnsigned(uint min, uint max)
        {
            uint val = 0;
            Arbutils.Generated.Random.GetUnsignedInLimits(Ptr, min, max, ref val).Assert();
            return val;
        }


        protected override void DeletePtr()
        {
            Arbutils.Generated.Random.Destruct(Ptr);
        }
    }
}