Exemplo n.º 1
0
 /// <summary>
 /// Construct a <see cref="Run"/>.
 /// </summary>
 /// <param name="time">The finished time.</param>
 /// <param name="span">The relative time.</param>
 /// <param name="runid">The run ID.</param>
 /// <param name="jid">The judging ID.</param>
 /// <param name="v">The verdict.</param>
 /// <param name="rank">The testcase rank.</param>
 /// <param name="timems">The time in milliseconds.</param>
 public Run(DateTimeOffset time, TimeSpan span, int runid, int jid, Xylab.Polygon.Entities.Verdict v, int rank, int timems)
 {
     Time            = time;
     ContestTime     = span;
     Id              = $"{runid}";
     JudgementId     = $"{jid}";
     JudgementTypeId = JudgementType.For(v) ?? "JE";
     Ordinal         = rank;
     RunTime         = timems / 1000.0;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Construct a <see cref="Judgement"/>.
        /// </summary>
        /// <param name="j">The judging entity.</param>
        /// <param name="contestTime">The contest start time.</param>
        /// <param name="verdict">The verdict to use instead.</param>
        /// <param name="fakeTime">The fake event time for rejudgings.</param>
        public Judgement(Xylab.Polygon.Entities.Judging j, DateTimeOffset contestTime, Xylab.Polygon.Entities.Verdict?verdict = null, DateTimeOffset?fakeTime = null)
        {
            _fakeTime        = fakeTime;
            Id               = $"{j.Id}";
            SubmissionId     = $"{j.SubmissionId}";
            JudgementTypeId  = JudgementType.For(verdict ?? j.Status);
            Valid            = j.Active;
            StartContestTime = j.StartTime !.Value - contestTime;
            StartTime        = j.StartTime !.Value;

            if (JudgementTypeId != null)
            {
                EndContestTime = j.StopTime !.Value - contestTime;
                EndTime        = j.StopTime !.Value;
                JudgementScore = j.TotalScore;
                if (JudgementTypeId != "CE" && JudgementTypeId != "JE")
                {
                    MaxRunTime = j.ExecuteTime / 1000.0;
                }
            }
        }