using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models.Game
{
    public class Dice
    {
        public int NbMin { get; private set; }

        public int NbMax { get; private set; }

        public int Value { get; private set; }

        public Dice(int nbmin)
        {
            if (nbmin < 0) nbmin = 0;
            if (nbmin > 1) nbmin = 1;
            NbMin = nbmin;
            NbMax = nbmin + 5;
        }

        public Dice()
        {
            NbMin = 0;
            NbMax = 5;
        }

        public override string ToString()
        {
            return $"Ce dé a pour valeur {Value} et est entre {NbMin} et {NbMax}";
        }

        public void Roll()
        {
            Value = new Random().Next(NbMin, NbMax + 1);
        }

        public bool IsLower(Dice dice2)
        {
            return dice2.Value > this.Value;
        }
    }
}