Exemple #1
0
 //Sort by Difficulty, if specified
 public static int CompareDifficulty(HitPoint lhs, HitPoint rhs)
 {
     if(lhs.HitDifficulty == rhs.HitDifficulty)
         return 0;
     else if(lhs.HitDifficulty< rhs.HitDifficulty)
         return -1;
     else
         return 1;
 }
Exemple #2
0
 //Sort by Time
 public static int CompareTime(HitPoint lhs, HitPoint rhs)
 {
     if(lhs.HitTime == rhs.HitTime)
         return 0;
     else if(lhs.HitTime < rhs.HitTime)
         return -1;
     else
         return 1;
 }
Exemple #3
0
 //Sort by Difficulty, if specified
 public static int CompareDifficulty(HitPoint lhs, HitPoint rhs)
 {
     if (lhs.HitDifficulty == rhs.HitDifficulty)
     {
         return(0);
     }
     else if (lhs.HitDifficulty < rhs.HitDifficulty)
     {
         return(-1);
     }
     else
     {
         return(1);
     }
 }
Exemple #4
0
 //Sort by Time
 public static int CompareTime(HitPoint lhs, HitPoint rhs)
 {
     if (lhs.HitTime == rhs.HitTime)
     {
         return(0);
     }
     else if (lhs.HitTime < rhs.HitTime)
     {
         return(-1);
     }
     else
     {
         return(1);
     }
 }
Exemple #5
0
 //Sort by Difficulty, by default
 public int CompareTo(object obj)
 {
     if (obj is HitPoint)
     {
         HitPoint otherpoint = (HitPoint)obj;
         if (this.HitDifficulty == otherpoint.HitDifficulty)
         {
             return(0);
         }
         else if (this.HitDifficulty < otherpoint.HitDifficulty)
         {
             return(-1);
         }
         else
         {
             return(1);
         }
     }
     else
     {
         throw new Exception("Error: object is not hitpoint");
     }
 }