1
0
mirror of https://github.com/ppy/osu synced 2024-12-14 19:06:07 +00:00

Simplify winner lookup

This commit is contained in:
Dean Herbert 2018-08-26 18:41:21 +09:00
parent bfc5ccd6d0
commit 041d826396

View File

@ -45,18 +45,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
if (pairing != null) if (pairing != null)
{ {
completed.BindTo(pairing.Completed); isWinner = () => pairing.Winner == Team;
if (team == pairing.Team1.Value) completed.BindTo(pairing.Completed);
{ score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score);
score.BindTo(pairing.Team1Score);
isWinner = () => pairing.Team1Score.Value > pairing.Team2Score.Value;
}
else
{
score.BindTo(pairing.Team2Score);
isWinner = () => pairing.Team2Score.Value > pairing.Team1Score.Value;
}
} }
} }