public static void UpdateTournamentResults(Tournament model)
        {
            int            startingRound   = model.CheckCurrentRound();
            List <Matchup> matchupsToScore = new List <Matchup>();

            foreach (List <Matchup> round in model.Rounds)
            {
                foreach (Matchup match in round)
                {
                    if (match.Winner == null && (match.Entries.Any(x => x.Score != 0) || match.Entries.Count == 1))
                    {
                        matchupsToScore.Add(match);
                    }
                }
            }

            MarkWinnersInMatchups(matchupsToScore);

            AdvanceWinners(matchupsToScore, model);

            matchupsToScore.ForEach(m => GlobalConfig.Connection.UpdateMatchup(m));

            int endingRound = model.CheckCurrentRound();

            if (endingRound > startingRound)
            {
                model.AlertUsersToNewRound();
            }
        }
Exemplo n.º 2
0
        public static void UpdateTournamentResults(Tournament model)
        {
            int            startingRound = model.CheckCurrentRound();
            List <Matchup> toScore       = new List <Matchup>();

            foreach (List <Matchup> round in model.Rounds)
            {
                foreach (Matchup rm in round)
                {
                    if (rm.Winner == null && (rm.Entrys.Any(x => x.Score != 0) || rm.Entrys.Count == 1))
                    {
                        toScore.Add(rm);
                    }
                }
            }

            MarkWinnerInMatchup(toScore);
            AdvanceWinners(toScore, model);


            toScore.ForEach(x => GlobalConfig.Connection.UpdateMatchup(x));

            int endingRound = model.CheckCurrentRound();

            if (endingRound > startingRound)
            {
                model.AlertUsersToNewRound();
            }
        }