1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00
osu-lazer/osu.Game.Tournament/Screens/Gameplay/Components/MatchRoundDisplay.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
923 B
C#
Raw Normal View History

// 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;
using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
namespace osu.Game.Tournament.Screens.Gameplay.Components
{
2020-03-12 12:29:09 +08:00
public partial class MatchRoundDisplay : TournamentSpriteTextWithBackground
{
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) =>
Text.Text = match.NewValue?.Round.Value?.Name.Value ?? "Unknown Round";
}
}