Make LinkFlowContainer handle beatmap id lookup in game.

This commit is contained in:
naoey
2018-03-09 19:46:16 +05:30
parent 25524bf24f
commit c304c1eecf
4 changed files with 39 additions and 7 deletions

View File

@ -5,13 +5,21 @@ namespace osu.Game.Online.API.Requests
{
public class GetBeatmapSetRequest : APIRequest<APIResponseBeatmapSet>
{
private readonly int beatmapSetId;
private readonly int id;
private readonly BeatmapSetLookupType type;
public GetBeatmapSetRequest(int beatmapSetId)
public GetBeatmapSetRequest(int id, BeatmapSetLookupType type = BeatmapSetLookupType.SetId)
{
this.beatmapSetId = beatmapSetId;
this.id = id;
this.type = type;
}
protected override string Target => $@"beatmapsets/{beatmapSetId}";
protected override string Target => type == BeatmapSetLookupType.SetId ? $@"beatmapsets/{id}" : $@"beatmapsets/lookup?beatmap_id={id}";
}
public enum BeatmapSetLookupType
{
SetId,
BeatmapId,
}
}