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

namespace Models
{
    public class De
    {
        public int NbMin { get; private set; }

        public int NbMax { get; private set; }

        public int Nb { get; private set; }

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

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

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

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