using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Model { public class NumberDie : Die { private int min; private int max; private static Random random=new Random(); public NumberDie(string name,int min,int max) : base(name) { Name = name; Min = min; Max = max; } public int Min { get { return min; } set { min = value; } } public int Max { get { return max; } set { max = value; } } public override int RandomFace() { int resultat = random.Next(min, max + 1); return resultat; } public bool Equals([AllowNull] NumberDie other) { return Name == other.Name && Min == other.Min && Max == other.Max; } public override bool Equals(object? obj) { //Check null if (ReferenceEquals(obj, null)) return false; //Check reference equality if (ReferenceEquals(obj, this)) return true; //Check types if (GetType() != obj.GetType()) return false; return Equals(obj as NumberDie); } } }