public void OnTriggerEnter(Collider other) { if (other.CompareTag("Goal")) { goalScored = new GoalScored(other.name == "Blue_Goal"); ServicesLocator.EventManager.Fire(goalScored); } }
public void StartFootballGames(List <IScorer> footballers) { BroadcastingFootball?.Invoke("___Football Time!___\n"); foreach (var country in Program.CountriesList) { BroadcastingFootball?.Invoke($"\n{country} players:"); foreach (var footPlayer in footballers) { if (footPlayer.CountryFrom == country) { BroadcastingFootball?.Invoke($"\t{footPlayer.Name} {footPlayer.Surname}"); } } Thread.Sleep(1200); } foreach (var country in Program.CountriesList) { BroadcastingFootball?.Invoke($"\n{country} is playing now!\n"); Thread.Sleep(1300); foreach (var footPlayer in footballers) { if (footPlayer.CountryFrom == country) { for (int i = 0; i < 5; i++) { if (footPlayer.IsScored()) { // BroadcastingFootball?.Invoke($"Goal! Congratulations!" + // $"{footPlayer.Name} {footPlayer.Surname} scored!"); GoalScored?.Invoke(this, new GoalEventArgs(footPlayer.Name, footPlayer.Surname)); Program.AddPoints(country, 1); } } } } BroadcastingFootball?.Invoke($"\n {country} Played all games\n" + $"Waiting for the next match..."); Thread.Sleep(2000); } BroadcastingFootball?.Invoke("\nFootball ended! All teams showed good work!\n" + "Now you can check Footballers in Football stats!"); }
public void IncrementTeamScore(AGPEvent e) { GoalScored goalScoreEvent = (GoalScored)e; if (goalScoreEvent.didRedTeamScore) { redTeamScore++; } else { blueTeamScore++; } }
public Task Handle(GoalScored message) { _store.AddGoal(message.Id, message.SetNumber, message.Scorer, message.TimeStamp); return(Task.CompletedTask); }