2020-03-06 07:07:54 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
2020-03-07 03:51:11 +00:00
|
|
|
using osu.Game.Tournament.Components;
|
2020-03-06 07:07:54 +00:00
|
|
|
using osu.Game.Tournament.Models;
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|
|
|
{
|
2020-03-07 03:51:11 +00:00
|
|
|
public class RoundDisplay : TournamentSpriteTextWithBackground
|
2020-03-06 07:07:54 +00:00
|
|
|
{
|
|
|
|
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(LadderInfo ladder)
|
|
|
|
{
|
|
|
|
currentMatch.BindValueChanged(matchChanged);
|
|
|
|
currentMatch.BindTo(ladder.CurrentMatch);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void matchChanged(ValueChangedEvent<TournamentMatch> match) =>
|
2020-03-07 03:51:11 +00:00
|
|
|
Text.Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round";
|
2020-03-06 07:07:54 +00:00
|
|
|
}
|
|
|
|
}
|