Files
oop/labs/lab9/Igra/Gamer.cs
2025-09-30 08:21:09 +03:00

31 lines
558 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
class Gamer
{
string Name;
IgralnayaKost seans;
public Gamer(string name)
{
Name = name;
seans = new IgralnayaKost();
seans.MaxRolled += OnMaxRolled;
}
void OnMaxRolled(int value)
{
Console.WriteLine("Событие: у игрока {0} выпало максимальное количество очков ({1})", Name, value);
}
public int SeansGame()
{
return seans.random();
}
public override string ToString()
{
return Name;
}
}