public LiveStandingTeam(ProcessedTeam team, ProcessedTeam otherTeam, Standings standings)
    {
        Standing oldStanding = findStanding(team.id, standings);

        standing = new Standing(oldStanding);

        teamName = team.entry != null ? team.entry.entry.name : "AVERAGE";
        teamId   = team.id;
        currentWeekScore.startingScore = team.score.startingScore;
        currentWeekScore.subScore      = team.score.subScore;

        if (doIncrementStandings(standing))
        {
            liveResult = "D";
            standing.matches_played++;
            standing.points_for += team.score.startingScore;
            if (team.score.startingScore > otherTeam.score.startingScore)
            {
                liveResult = "W";
                standing.matches_won++;
                standing.points_total += 3;
            }
            else if (team.score.startingScore < otherTeam.score.startingScore)
            {
                liveResult = "L";
                standing.matches_lost++;
                standing.points_total += 0;
            }
            else
            {
                standing.matches_drawn++;
                standing.points_total += 1;
            }
        }
    }
    public static void EstimateAverageScore(IDictionary <int, ProcessedTeam> teams)
    {
        ProcessedTeam average = null;

        average = teams.TryGetValue(0, out average) ? average : null;
        if (average != null)
        {
            int totalScore = 0;
            int numAvgd    = 0;
            foreach (ProcessedTeam team in teams.Values)
            {
                if (team.id != 0)
                {
                    totalScore += team.score.startingScore + team.transferCost;
                    numAvgd++;
                }
            }
            int avgScore = totalScore / numAvgd;
            average.score.startingScore = avgScore;
        }
    }
示例#3
0
 public ProcessedMatchTeam(ProcessedTeam baseTeam, Standing stand)
     : base(baseTeam.id, baseTeam.entry, baseTeam.picks, baseTeam.score, baseTeam.events, baseTeam.activeChip, baseTeam.history, baseTeam.form)
 {
     standing = stand;
 }