Skip to content

Commit

Permalink
ensure losing streaks count as lower when the number is higher
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Mar 10, 2024
1 parent 5487709 commit eaecb78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Maui.DataGrid.Sample/Models/Team.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public int CompareTo(object? obj)
return resultComparison;
}

var winLossIndicator = Result == Result.Won ? 1 : -1;

// If Result is the same, then compare the NumStreak
return NumStreak.CompareTo(s.NumStreak);
return winLossIndicator * NumStreak.CompareTo(s.NumStreak);
}

throw new ArgumentException("Object is not a Streak");
Expand Down

0 comments on commit eaecb78

Please sign in to comment.