mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
replace BeatmapResponse with BeatmapInfo
This commit is contained in:
@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
public override string Description => "User's History";
|
public override string Description => "User's History";
|
||||||
|
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new [] { typeof(HistoricalSection), typeof(MostPlayedBeatmapDrawable)};
|
public override IReadOnlyList<Type> RequiredTypes => new [] { typeof(HistoricalSection), typeof(PaginatedMostPlayedBeatmapContainer), typeof(MostPlayedBeatmapDrawable) };
|
||||||
|
|
||||||
|
|
||||||
public TestCaseHistoricalSection()
|
public TestCaseHistoricalSection()
|
||||||
|
@ -115,6 +115,7 @@ namespace osu.Game.Beatmaps
|
|||||||
// Metadata
|
// Metadata
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("difficulty_rating")]
|
||||||
public double StarDifficulty { get; set; }
|
public double StarDifficulty { get; set; }
|
||||||
|
|
||||||
public bool Equals(BeatmapInfo other)
|
public bool Equals(BeatmapInfo other)
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@ -28,7 +27,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public int PlayCount;
|
public int PlayCount;
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
private BeatmapResponse beatmap;
|
private BeatmapInfo beatmap;
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
private GetBeatmapSetsResponse beatmapSet;
|
private GetBeatmapSetsResponse beatmapSet;
|
||||||
@ -36,31 +35,10 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets)
|
public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
BeatmapSetInfo setInfo = beatmapSet.ToBeatmapSet(rulesets);
|
BeatmapSetInfo setInfo = beatmapSet.ToBeatmapSet(rulesets);
|
||||||
return new BeatmapInfo
|
beatmap.BeatmapSet = setInfo;
|
||||||
{
|
beatmap.OnlineBeatmapSetID = setInfo.OnlineBeatmapSetID;
|
||||||
OnlineBeatmapID = beatmap.Id,
|
beatmap.Metadata = setInfo.Metadata;
|
||||||
OnlineBeatmapSetID = setInfo.OnlineBeatmapSetID,
|
return beatmap;
|
||||||
Ruleset = rulesets.AvailableRulesets.FirstOrDefault(ruleset => ruleset.Name.Equals(beatmap.Mode)),
|
|
||||||
StarDifficulty = beatmap.DifficultyRating,
|
|
||||||
Version = beatmap.Version,
|
|
||||||
Metadata = setInfo.Metadata,
|
|
||||||
BeatmapSet = setInfo,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private class BeatmapResponse
|
|
||||||
{
|
|
||||||
[JsonProperty]
|
|
||||||
public int Id;
|
|
||||||
|
|
||||||
[JsonProperty]
|
|
||||||
public string Mode;
|
|
||||||
|
|
||||||
[JsonProperty("difficulty_rating")]
|
|
||||||
public double DifficultyRating;
|
|
||||||
|
|
||||||
[JsonProperty]
|
|
||||||
public string Version;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user