Пример #1
0
        public Coach(GameMediator gameMediator)
        {
            this._gameMediator = gameMediator;

            gameMediator._ev += (sender, args) =>
            {
                if (args is PlayerScoredEventArgs s && s.GoalsScored < 3)
                {
                    Console.WriteLine($"good job {s.PlayerName}");
                }
                args.Print();
            };
        }
Пример #2
0
 public Player(string name, GameMediator gameMediator)
 {
     this.gameMediator = gameMediator;
     Name = name;
 }