mirror of
https://github.com/ppy/osu
synced 2025-02-10 07:07:53 +00:00
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
// 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 System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using osu.Game.Online.API;
|
|
using osu.Game.Online.API.Requests;
|
|
using osu.Game.Online.Multiplayer;
|
|
using osu.Game.Scoring;
|
|
using osu.Game.Screens.Ranking;
|
|
|
|
namespace osu.Game.Screens.Multi.Ranking
|
|
{
|
|
public class TimeshiftResultsScreen : ResultsScreen
|
|
{
|
|
private readonly int roomId;
|
|
private readonly PlaylistItem playlistItem;
|
|
|
|
public TimeshiftResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry = true)
|
|
: base(score, allowRetry)
|
|
{
|
|
this.roomId = roomId;
|
|
this.playlistItem = playlistItem;
|
|
}
|
|
|
|
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
|
{
|
|
var req = new GetRoomPlaylistScoresRequest(roomId, playlistItem.ID);
|
|
req.Success += r => scoresCallback?.Invoke(r.Scores.Where(s => s.ID != Score?.OnlineScoreID).Select(s => s.CreateScoreInfo(playlistItem)));
|
|
return req;
|
|
}
|
|
}
|
|
}
|