예제 #1
0
 public static bool IsBetterThan(ChallengeRecordEntry x1, ChallengeRecordEntry x2)
 {
     if (x1.enGradeType == ChallengeDataHolder.GradeType.Time_LowerIsBetter)
     {
         if (x1.iValue < x2.iValue)
         {
             return true;
         }
     }
     else if (x1.enGradeType == ChallengeDataHolder.GradeType.DamageTaken && x1.iValue < x2.iValue)
     {
         return true;
     }
     return false;
 }
예제 #2
0
 public static ChallengeRecord MergeRecords(ChallengeRecord x1, ChallengeRecord x2)
 {
     ChallengeDataHolder.Grade enTotalBest = ChallengeDataHolder.Grade.C;
     if (x1.enTotalGrade > enTotalBest)
     {
         enTotalBest = x1.enTotalGrade;
     }
     if (x2.enTotalGrade > enTotalBest)
     {
         enTotalBest = x2.enTotalGrade;
     }
     ChallengeRecordEntry[] banan = new ChallengeRecordEntry[x1.lxSubGrades.Count];
     for (int i = 0; i < banan.Length; i++)
     {
         if (ChallengeDataHolder.IsBetterThan(x1.lxSubGrades[i], x2.lxSubGrades[i]))
         {
             banan[i] = x1.lxSubGrades[i];
         }
         else
         {
             banan[i] = x2.lxSubGrades[i];
         }
     }
     return new ChallengeRecord(enTotalBest, banan);
 }