Rename all remaining cases

This commit is contained in:
Dean Herbert
2021-10-03 00:55:29 +09:00
parent 973c31132b
commit ec61c3c5ee
58 changed files with 342 additions and 341 deletions

View File

@ -8,13 +8,13 @@ namespace osu.Game.Online.API.Requests
{
public class GetBeatmapRequest : APIRequest<APIBeatmap>
{
private readonly BeatmapInfo beatmap;
private readonly BeatmapInfo beatmapInfo;
public GetBeatmapRequest(BeatmapInfo beatmap)
public GetBeatmapRequest(BeatmapInfo beatmapInfo)
{
this.beatmap = beatmap;
this.beatmapInfo = beatmapInfo;
}
protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path ?? string.Empty)}";
protected override string Target => $@"beatmaps/lookup?id={beatmapInfo.OnlineBeatmapID}&checksum={beatmapInfo.MD5Hash}&filename={System.Uri.EscapeUriString(beatmapInfo.Path ?? string.Empty)}";
}
}

View File

@ -15,20 +15,20 @@ namespace osu.Game.Online.API.Requests
{
public class GetScoresRequest : APIRequest<APILegacyScores>
{
private readonly BeatmapInfo beatmap;
private readonly BeatmapInfo beatmapInfo;
private readonly BeatmapLeaderboardScope scope;
private readonly RulesetInfo ruleset;
private readonly IEnumerable<IMod> mods;
public GetScoresRequest(BeatmapInfo beatmap, RulesetInfo ruleset, BeatmapLeaderboardScope scope = BeatmapLeaderboardScope.Global, IEnumerable<IMod> mods = null)
public GetScoresRequest(BeatmapInfo beatmapInfo, RulesetInfo ruleset, BeatmapLeaderboardScope scope = BeatmapLeaderboardScope.Global, IEnumerable<IMod> mods = null)
{
if (!beatmap.OnlineBeatmapID.HasValue)
if (!beatmapInfo.OnlineBeatmapID.HasValue)
throw new InvalidOperationException($"Cannot lookup a beatmap's scores without having a populated {nameof(BeatmapInfo.OnlineBeatmapID)}.");
if (scope == BeatmapLeaderboardScope.Local)
throw new InvalidOperationException("Should not attempt to request online scores for a local scoped leaderboard");
this.beatmap = beatmap;
this.beatmapInfo = beatmapInfo;
this.scope = scope;
this.ruleset = ruleset ?? throw new ArgumentNullException(nameof(ruleset));
this.mods = mods ?? Array.Empty<IMod>();
@ -42,7 +42,7 @@ namespace osu.Game.Online.API.Requests
foreach (APILegacyScoreInfo score in r.Scores)
{
score.Beatmap = beatmap;
score.BeatmapInfo = beatmapInfo;
score.OnlineRulesetID = ruleset.ID.Value;
}
@ -50,12 +50,12 @@ namespace osu.Game.Online.API.Requests
if (userScore != null)
{
userScore.Score.Beatmap = beatmap;
userScore.Score.BeatmapInfo = beatmapInfo;
userScore.Score.OnlineRulesetID = ruleset.ID.Value;
}
}
protected override string Target => $@"beatmaps/{beatmap.OnlineBeatmapID}/scores{createQueryParameters()}";
protected override string Target => $@"beatmaps/{beatmapInfo.OnlineBeatmapID}/scores{createQueryParameters()}";
private string createQueryParameters()
{

View File

@ -64,7 +64,7 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"max_combo")]
private int? maxCombo { get; set; }
public virtual BeatmapInfo ToBeatmap(RulesetStore rulesets)
public virtual BeatmapInfo ToBeatmapInfo(RulesetStore rulesets)
{
var set = BeatmapSet?.ToBeatmapSet(rulesets);

View File

@ -116,7 +116,7 @@ namespace osu.Game.Online.API.Requests.Responses
beatmapSet.Beatmaps = beatmaps?.Select(b =>
{
var beatmap = b.ToBeatmap(rulesets);
var beatmap = b.ToBeatmapInfo(rulesets);
beatmap.BeatmapSet = beatmapSet;
beatmap.Metadata = beatmapSet.Metadata;
return beatmap;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Online.API.Requests.Responses
OnlineScoreID = OnlineScoreID,
Date = Date,
PP = PP,
Beatmap = Beatmap,
Beatmap = BeatmapInfo,
RulesetID = OnlineRulesetID,
Hash = Replay ? "online" : string.Empty, // todo: temporary?
Rank = Rank,
@ -100,7 +100,7 @@ namespace osu.Game.Online.API.Requests.Responses
public DateTimeOffset Date { get; set; }
[JsonProperty(@"beatmap")]
public BeatmapInfo Beatmap { get; set; }
public BeatmapInfo BeatmapInfo { get; set; }
[JsonProperty("accuracy")]
public double Accuracy { get; set; }
@ -114,10 +114,10 @@ namespace osu.Game.Online.API.Requests.Responses
set
{
// extract the set ID to its correct place.
Beatmap.BeatmapSet = new BeatmapSetInfo { OnlineBeatmapSetID = value.ID };
BeatmapInfo.BeatmapSet = new BeatmapSetInfo { OnlineBeatmapSetID = value.ID };
value.ID = 0;
Beatmap.Metadata = value;
BeatmapInfo.Metadata = value;
}
}

View File

@ -16,7 +16,7 @@ namespace osu.Game.Online.API.Requests.Responses
public int PlayCount { get; set; }
[JsonProperty]
private BeatmapInfo beatmap { get; set; }
private BeatmapInfo beatmapInfo { get; set; }
[JsonProperty]
private APIBeatmapSet beatmapSet { get; set; }
@ -24,9 +24,9 @@ namespace osu.Game.Online.API.Requests.Responses
public BeatmapInfo GetBeatmapInfo(RulesetStore rulesets)
{
BeatmapSetInfo setInfo = beatmapSet.ToBeatmapSet(rulesets);
beatmap.BeatmapSet = setInfo;
beatmap.Metadata = setInfo.Metadata;
return beatmap;
beatmapInfo.BeatmapSet = setInfo;
beatmapInfo.Metadata = setInfo.Metadata;
return beatmapInfo;
}
}
}