Initial EF Core commit

This commit is contained in:
TocoToucan
2017-10-04 22:52:12 +03:00
parent de840a5c9e
commit 6a4198d0d6
93 changed files with 730 additions and 708 deletions

View File

@ -19,6 +19,6 @@ namespace osu.Game.Online.API.Requests
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
}
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download";
protected override string Target => $@"beatmapsets/{BeatmapSet.BeatmapSetOnlineInfoId}/download";
}
}

View File

@ -10,7 +10,7 @@ namespace osu.Game.Online.API.Requests
{
private readonly BeatmapInfo beatmap;
private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
private string lookupString => beatmap.BeatmapOnlineInfoId > 0 ? beatmap.BeatmapOnlineInfoId.ToString() : $@"lookup?checksum={beatmap.Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
public GetBeatmapDetailsRequest(BeatmapInfo beatmap)
{

View File

@ -30,7 +30,7 @@ namespace osu.Game.Online.API.Requests
this.direction = direction;
}
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}";
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.Id ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}";
}
public class GetBeatmapSetsResponse : BeatmapMetadata
@ -63,8 +63,8 @@ namespace osu.Game.Online.API.Requests
{
return new BeatmapSetInfo
{
OnlineBeatmapSetID = onlineId,
Metadata = this,
BeatmapSetOnlineInfoId = onlineId,
BeatmapMetadata = this,
OnlineInfo = new BeatmapSetOnlineInfo
{
Author = new User
@ -99,8 +99,8 @@ namespace osu.Game.Online.API.Requests
{
return new BeatmapInfo
{
Metadata = this,
Ruleset = rulesets.GetRuleset(ruleset),
BeatmapMetadata = this,
RulesetInfo = rulesets.GetRuleset(ruleset),
StarDifficulty = starDifficulty,
OnlineInfo = new BeatmapOnlineInfo
{

View File

@ -18,8 +18,8 @@ namespace osu.Game.Online.API.Requests
public GetScoresRequest(BeatmapInfo beatmap)
{
if (!beatmap.OnlineBeatmapID.HasValue)
throw new InvalidOperationException($"Cannot lookup a beatmap's scores without having a populated {nameof(BeatmapInfo.OnlineBeatmapID)}.");
if (!beatmap.BeatmapOnlineInfoId.HasValue)
throw new InvalidOperationException($"Cannot lookup a beatmap's scores without having a populated {nameof(BeatmapInfo.BeatmapOnlineInfoId)}.");
this.beatmap = beatmap;
@ -32,7 +32,7 @@ namespace osu.Game.Online.API.Requests
score.ApplyBeatmap(beatmap);
}
protected override string Target => $@"beatmaps/{beatmap.OnlineBeatmapID}/scores";
protected override string Target => $@"beatmaps/{beatmap.BeatmapOnlineInfoId}/scores";
}
public class GetScoresResponse
@ -116,7 +116,7 @@ namespace osu.Game.Online.API.Requests
public void ApplyBeatmap(BeatmapInfo beatmap)
{
Beatmap = beatmap;
Ruleset = beatmap.Ruleset;
Ruleset = beatmap.RulesetInfo;
// Evaluate the mod string
Mods = Ruleset.CreateInstance().GetAllMods().Where(mod => modStrings.Contains(mod.ShortenedName)).ToArray();