static void Main(string[] args) { Team team1 = new Team("Мурзилки", new Coach("Петров")); Team team2 = new Team("Пупсики", new Coach("Иванов")); team1.AddPlayer(new Footballer("Месси", 30)); team1.AddPlayer(new Footballer("Шевченко", 20)); team2.AddPlayer(new Footballer("Роналду", 41)); team2.AddPlayer(new Footballer("Суарес", 39)); team2.AddPlayer(new Footballer("Неймар", 29)); team1.AddPlayer(new Footballer("Санчес", 20)); team1.AddPlayer(new Footballer("Бонуччи", 49)); Referee referee = new Referee("Александров"); Game newGame = new Game(team1, team2, referee); Del del = team1.CoachInfo; del += team2.CoachInfo; del(); Console.WriteLine(); newGame.ResultGame(); del = team1.ListAll; del += team2.ListAll; del += team1.ListOverThirty; del += team2.ListOverThirty; del(); Score score = new Score(team1, team2); Console.WriteLine("Игра началась"); Fans team1Fans = new Fans(team1, 1000); Fans team2Fans = new Fans(team2, 500); team1Fans.FansInfo(); team2Fans.FansInfo(); Console.WriteLine(); Console.WriteLine($"{team1.team_name} - {team2.team_name}"); score.PrintScore(); Random r = new Random(); for (int i = 0; i < 6; i++) { newGame.Event += referee.GoalHandler; newGame.Event += score.PlusScore; score.number = r.Next(1, 101); score.team = r.Next(1, 3); if (score.number < 20) { newGame.Event += score.YellowCard; newGame.Event += referee.FoulHandler; newGame.Event += score.PrintYellowCard; } newGame.Event += score.PrintScore; } newGame.StartGame(); score.Winner(); newGame.raining = false; team1.List(); team2.List(); }
public Game(Team t1, Team t2, Referee referee) { this.t1 = t1; this.t2 = t2; this.referee = referee; }