public RunJudging(RoundContestant contestant, Judge judge, JudgingCriterion criterion, int runNo, decimal?score) : this() { RoundContestant = contestant; RoundContestantId = contestant.Id; Judge = judge; JudgeId = judge.Id; Criterion = criterion; CriterionId = criterion.Id; RunNo = runNo; Score = score; }
public RoundContestant AddContesant(Contestant contestant) { contestant.EnsureListsAreInitialized(); var rc = new RoundContestant() { Contestant = contestant, Round = this }; contestant.RoundParticipations.Add(rc); this.ContestantEntries.Add(rc); return(rc); }
public void AssignHeatFor(RoundContestant rc) { var contestants = ContestantEntries.ToList(); var maxHeat = contestants.Max(p => p.HeatNo); int ordinal = contestants.Max(p => p.Ordinal) + 1; var playersInHeat = contestants.Count(p => p.HeatNo == maxHeat); if (playersInHeat >= ContestantsPerHeat) { maxHeat++; } rc.HeatNo = maxHeat; rc.Ordinal = ordinal; }