private static void DisplayPlayerLoadingErrors(PlayerLoader loader) { if (loader.ValidationErrors.Count > 0) { Console.WriteLine("Player Load Validation Errors"); Console.WriteLine("─────────────────────────────"); } DisplayHelper.SetTextColour(ConsoleColor.Red); foreach (var error in loader.ValidationErrors) { Console.WriteLine(error); } DisplayHelper.ResetTextColour(); }
static void Main(string[] args) { DisplayHelper.ShowWelcomeMessage(); Thread.Sleep(2000); Console.Clear(); var playerTypes = TypeLoader.LoadTypesFromAssembliesIn(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)); var loader = new PlayerLoader(); var players = loader.LoadPlayersFrom(playerTypes); DisplayPlayerLoadingErrors(loader); if (players.Count < MIN_PLAYERS) { DisplayHelper.ShowNotEnoughPlayersWarning(); return; } DisplayPlayers(players); DisplayHelper.AnyKeyToContinue("\n[Press any key to continue..]"); var tournament = new Tournament(players); tournament.ScheduleGames(); PlayGames(tournament); DisplayHelper.AnyKeyToContinue("\n[Press any key to see the results..]"); tournament.AllocateTournamentPoints(); var menu = new Menu(tournament); menu.DisplayTournamentResults(); menu.DisplayGamesMenu(); }