From 041d8263961e746fedf1058227aa1a22c52e348b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 18:41:21 +0900 Subject: [PATCH] Simplify winner lookup --- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 1a190b4cc7..1f2447ef06 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -45,18 +45,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (pairing != null) { - completed.BindTo(pairing.Completed); + isWinner = () => pairing.Winner == Team; - if (team == pairing.Team1.Value) - { - score.BindTo(pairing.Team1Score); - isWinner = () => pairing.Team1Score.Value > pairing.Team2Score.Value; - } - else - { - score.BindTo(pairing.Team2Score); - isWinner = () => pairing.Team2Score.Value > pairing.Team1Score.Value; - } + completed.BindTo(pairing.Completed); + score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); } }