Add the concept of "current match"

This commit is contained in:
Dean Herbert
2018-11-06 20:13:04 +09:00
parent 3427127589
commit 4e87288049
3 changed files with 41 additions and 22 deletions

View File

@ -3,6 +3,7 @@
using System.Drawing;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
@ -28,6 +29,9 @@ namespace osu.Game.Tournament
[Cached]
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
[Cached]
private readonly Bindable<MatchPairing> currentMatch = new Bindable<MatchPairing>();
private Bindable<Size> windowSize;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
@ -51,6 +55,10 @@ namespace osu.Game.Tournament
}
Ladder = content != null ? JsonConvert.DeserializeObject<LadderInfo>(content) : new LadderInfo();
//todo: temp
currentMatch.Value = Ladder.Pairings.FirstOrDefault();
dependencies.Cache(Ladder);
bool addedInfo = false;