21 lines
306 B
C#
21 lines
306 B
C#
using System;
|
|
|
|
class IgralnayaKost
|
|
{
|
|
readonly Random r;
|
|
public event Action<int> MaxRolled;
|
|
|
|
public IgralnayaKost()
|
|
{
|
|
r = new Random();
|
|
}
|
|
|
|
public int random()
|
|
{
|
|
int res = r.Next(6) + 1;
|
|
if (res == 6) MaxRolled?.Invoke(res);
|
|
return res;
|
|
}
|
|
}
|
|
|