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); }
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)); }
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; }