Exemplo n.º 1
0
 public bool IsScoreEqual(ScoreRow other)
 {
     int[] thisScores = GetSortedScores();
     int[] rowScores  = other.GetSortedScores();
     for (int i = 0; i < thisScores.Length; ++i)
     {
         if (thisScores[i] != rowScores[i])
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
        public int CompareTo(object other)
        {
            if (!(other is ScoreRow))
            {
                throw new ArgumentException("Can only compare with other ScoreRows.");
            }
            ScoreRow row = (ScoreRow)other;

            int[] thisScores = GetSortedScores();
            int[] rowScores  = row.GetSortedScores();
            for (int i = thisScores.Length - 1; i >= 0; --i)
            {
                int comp = thisScores[i].CompareTo(rowScores[i]);
                if (comp != 0)
                {
                    return(-comp);
                }
            }

            return(TeamNameComparer.Compare(Number, Name, row.Number, row.Name));
        }
Exemplo n.º 3
0
 public bool IsScoreEqual(ScoreRow other)
 {
     int[] thisScores = GetSortedScores();
       int[] rowScores = other.GetSortedScores();
       for (int i = 0; i < thisScores.Length; ++i) {
     if (thisScores[i] != rowScores[i])
       return false;
       }
       return true;
 }