public int CompareTo(IStatus other) { var actionState = ((Action == RepoStatus.Waiting) || (Action == RepoStatus.Finished)) && (other.Action != RepoStatus.Waiting) && (other.Action != RepoStatus.Finished) ? 1 : 0; if (actionState != 0) { return(actionState); } if ((Progress > 0.00) && (Progress < 100.0) && ((other.Progress <= 0.00) || (other.Progress >= 100))) { return(-1); } if (((Progress <= 0.00) || (Progress >= 100)) && ((other.Progress <= 0.00) || (other.Progress >= 100))) { return(0); } if ((other.Progress > 0.00) && (other.Progress < 100.0) && ((Progress <= 0.00) || (Progress >= 100))) { return(1); } return(Progress.CompareTo(other.Progress)); }
public int CompareTo(HrustPlayer player) { int result = -TotalExercisesRank.Index.CompareTo(player.TotalExercisesRank.Index); if (result == 0) { result = -Progress.CompareTo(player.Progress); } if (result == 0) { result = -ExercisesRecordsSum.CompareTo(player.ExercisesRecordsSum); } return(result); }
public int CompareTo(Student other) { return(Progress.CompareTo(other.Progress)); }