Ejemplo n.º 1
0
        protected override List <StandingsEntry <Better> > CreateStandingsList(Tournament tournament)
        {
            List <StandingsEntry <Better> > betterStandings = new List <StandingsEntry <Better> >();

            foreach (Better better in tournament.Betters)
            {
                betterStandings.Add(StandingsEntry <Better> .Create(better));
            }

            return(betterStandings);
        }
Ejemplo n.º 2
0
        protected override List <StandingsEntry <PlayerReference> > CreateStandingsList(GroupBase group)
        {
            List <StandingsEntry <PlayerReference> > playerStandings = new List <StandingsEntry <PlayerReference> >();
            List <PlayerReference> playerReferences = group.GetPlayerReferences();

            foreach (PlayerReference participant in playerReferences)
            {
                playerStandings.Add(StandingsEntry <PlayerReference> .Create(participant));
            }

            return(playerStandings);
        }
Ejemplo n.º 3
0
        protected override void AggregatePointsForStandingEntries(GroupBase group, List <StandingsEntry <PlayerReference> > playerStandings)
        {
            foreach (Match match in group.Matches)
            {
                Player winner = match.GetWinningPlayer();

                if (winner == null)
                {
                    continue;
                }

                StandingsEntry <PlayerReference> playerStandingEntry = playerStandings.Find(player => player.Object.Id == winner.PlayerReferenceId);

                if (playerStandingEntry == null)
                {
                    // LOG Error: Failed to find player reference when calculating player standings for some reason
                    throw new Exception("Failed to find player reference when calculating player standings for some reason");
                }

                playerStandingEntry.AddPoint();
            }
        }