You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.2 KiB
60 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
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 override bool Equals(object? obj)
|
|
// {
|
|
// return obj is NumberDie die &&
|
|
// Name == die.Name &&
|
|
// min == die.min &&
|
|
// max == die.max;
|
|
// }
|
|
}
|
|
}
|