protected override void LoadComplete() { base.LoadComplete(); SelectedItem.BindValueChanged(item => { // the underlying playlist is regularly cleared for maintenance purposes (things which probably need to be fixed eventually). // to avoid exposing a state change when there may actually be none, ignore all nulls for now. if (item.NewValue == null) { return; } downloadTracker?.RemoveAndDisposeImmediately(); selectedBeatmap = null; beatmapLookupCache.GetBeatmapAsync(item.NewValue.Beatmap.OnlineID).ContinueWith(task => Schedule(() => { var beatmap = task.GetResultSafely(); if (SelectedItem.Value?.Beatmap.OnlineID == beatmap.OnlineID) { selectedBeatmap = beatmap; beginTracking(); } }), TaskContinuationOptions.OnlyOnRanToCompletion); }, true); }
private void success(APIBeatmap beatmap) { Add(new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); }
private void success(APIBeatmap apiBeatmap) { var beatmap = apiBeatmap.ToBeatmap(rulesets); Add(new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); }
public TournamentBeatmapPanel(APIBeatmap beatmap, string mod = null) { if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); Beatmap = beatmap; this.mod = mod; Width = 400; Height = HEIGHT; }
public TournamentBeatmap(APIBeatmap beatmap) { OnlineID = beatmap.OnlineID; DifficultyName = beatmap.DifficultyName; BPM = beatmap.BPM; Length = beatmap.Length; StarRating = beatmap.StarRating; Metadata = beatmap.Metadata; Difficulty = beatmap.Difficulty; Covers = beatmap.BeatmapSet.AsNonNull().Covers; }
private void success(APIBeatmap beatmap) { var mods = rulesets.GetRuleset(Ladder.Ruleset.Value.ID ?? 0).CreateInstance().AllMods; foreach (var mod in mods) { fillFlow.Add(new TournamentBeatmapPanel(beatmap, mod.Acronym) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); } }
private void success(APIBeatmap beatmap) { var ruleset = rulesets.GetRuleset(Ladder.Ruleset.Value.OnlineID); if (ruleset == null) { return; } var mods = ruleset.CreateInstance().AllMods; foreach (var mod in mods) { fillFlow.Add(new TournamentBeatmapPanel(new TournamentBeatmap(beatmap), mod.Acronym) { Anchor = Anchor.Centre, Origin = Anchor.Centre }); } }