theme changed
This commit is contained in:
20
labs/lab9/Igra/IgralnayaKost.cs
Normal file
20
labs/lab9/Igra/IgralnayaKost.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user