Rework EF Core usage in model classes

This commit is contained in:
TocoToucan
2017-10-06 00:23:26 +03:00
parent 6a4198d0d6
commit 887aa7496b
60 changed files with 216 additions and 223 deletions

View File

@ -24,12 +24,12 @@ namespace osu.Game.Tests.Visual
AddStep("beatmap all metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "All Metrics",
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Source = "osu!lazer",
Tags = "this beatmap has all the metrics",
},
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
CircleSize = 7,
DrainRate = 1,
@ -48,12 +48,12 @@ namespace osu.Game.Tests.Visual
AddStep("beatmap ratings", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Ratings",
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Source = "osu!lazer",
Tags = "this beatmap has ratings metrics but not retries or fails",
},
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
CircleSize = 6,
DrainRate = 9,
@ -70,12 +70,12 @@ namespace osu.Game.Tests.Visual
AddStep("beatmap fails retries", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Retries and Fails",
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Source = "osu!lazer",
Tags = "this beatmap has retries and fails but no ratings",
},
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
CircleSize = 3.7f,
DrainRate = 6,
@ -93,12 +93,12 @@ namespace osu.Game.Tests.Visual
AddStep("beatmap no metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "No Metrics",
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Source = "osu!lazer",
Tags = "this beatmap has no metrics",
},
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
CircleSize = 5,
DrainRate = 5,

View File

@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual
{
overlay.ShowBeatmapSet(new BeatmapSetInfo
{
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"Lachryma <Re:QueenM>",
Artist = @"Kaneko Chiharu",
@ -64,8 +64,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 1.36,
Version = @"BASIC",
RulesetInfo = mania,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = mania,
Difficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 6.5f,
@ -92,8 +92,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 2.22,
Version = @"NOVICE",
RulesetInfo = mania,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = mania,
Difficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 7,
@ -120,8 +120,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 3.49,
Version = @"ADVANCED",
RulesetInfo = mania,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = mania,
Difficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 7.5f,
@ -148,8 +148,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 4.24,
Version = @"EXHAUST",
RulesetInfo = mania,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = mania,
Difficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 8,
@ -176,8 +176,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 5.26,
Version = @"GRAVITY",
RulesetInfo = mania,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = mania,
Difficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 8.5f,
@ -208,7 +208,7 @@ namespace osu.Game.Tests.Visual
{
overlay.ShowBeatmapSet(new BeatmapSetInfo
{
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"Soumatou Labyrinth",
Artist = @"Yunomi with Momobako&miko",
@ -238,8 +238,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 1.40,
Version = @"yzrin's Kantan",
RulesetInfo = taiko,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = taiko,
Difficulty = new BeatmapDifficulty
{
CircleSize = 2,
DrainRate = 7,
@ -266,8 +266,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 2.23,
Version = @"Futsuu",
RulesetInfo = taiko,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = taiko,
Difficulty = new BeatmapDifficulty
{
CircleSize = 2,
DrainRate = 6,
@ -294,8 +294,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 3.19,
Version = @"Muzukashii",
RulesetInfo = taiko,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = taiko,
Difficulty = new BeatmapDifficulty
{
CircleSize = 2,
DrainRate = 6,
@ -322,8 +322,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 3.97,
Version = @"Charlotte's Oni",
RulesetInfo = taiko,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = taiko,
Difficulty = new BeatmapDifficulty
{
CircleSize = 5,
DrainRate = 6,
@ -350,8 +350,8 @@ namespace osu.Game.Tests.Visual
{
StarDifficulty = 5.08,
Version = @"Labyrinth Oni",
RulesetInfo = taiko,
BeatmapDifficulty = new BeatmapDifficulty
Ruleset = taiko,
Difficulty = new BeatmapDifficulty
{
CircleSize = 5,
DrainRate = 5,

View File

@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual
new BeatmapSetInfo
{
BeatmapSetOnlineInfoId = 578332,
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"OrVid",
Artist = @"An",
@ -65,16 +65,16 @@ namespace osu.Game.Tests.Visual
{
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 5.35f,
BeatmapMetadata = new BeatmapMetadata(),
Metadata = new BeatmapMetadata(),
},
},
},
new BeatmapSetInfo
{
BeatmapSetOnlineInfoId = 599627,
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"tiny lamp",
Artist = @"fhana",
@ -97,16 +97,16 @@ namespace osu.Game.Tests.Visual
{
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 5.81f,
BeatmapMetadata = new BeatmapMetadata(),
Metadata = new BeatmapMetadata(),
},
},
},
new BeatmapSetInfo
{
BeatmapSetOnlineInfoId = 513268,
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"At Gwanghwamun",
Artist = @"KYUHYUN",
@ -129,23 +129,23 @@ namespace osu.Game.Tests.Visual
{
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 0.9f,
BeatmapMetadata = new BeatmapMetadata(),
Metadata = new BeatmapMetadata(),
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 1.1f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 2.02f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 3.49f,
},
},
@ -153,7 +153,7 @@ namespace osu.Game.Tests.Visual
new BeatmapSetInfo
{
BeatmapSetOnlineInfoId = 586841,
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
Title = @"RHAPSODY OF BLUE SKY",
Artist = @"fhana",
@ -176,43 +176,43 @@ namespace osu.Game.Tests.Visual
{
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 1.26f,
BeatmapMetadata = new BeatmapMetadata(),
Metadata = new BeatmapMetadata(),
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 2.01f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 2.87f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 3.76f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 3.93f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 4.37f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 5.13f,
},
new BeatmapInfo
{
RulesetInfo = ruleset,
Ruleset = ruleset,
StarDifficulty = 5.42f,
},
},

View File

@ -43,13 +43,13 @@ namespace osu.Game.Tests.Visual
Value = new BeatmapInfo
{
StarDifficulty = 4.65,
RulesetInfo = rulesets.GetRuleset(3),
BeatmapMetadata = new BeatmapMetadata
Ruleset = rulesets.GetRuleset(3),
Metadata = new BeatmapMetadata
{
Title = @"Critical Crystal",
Artist = @"Seiryu",
},
BeatmapSetInfo = new BeatmapSetInfo
BeatmapSet = new BeatmapSetInfo
{
OnlineInfo = new BeatmapSetOnlineInfo
{
@ -81,13 +81,13 @@ namespace osu.Game.Tests.Visual
Value = new BeatmapInfo
{
StarDifficulty = 1.96,
RulesetInfo = rulesets.GetRuleset(0),
BeatmapMetadata = new BeatmapMetadata
Ruleset = rulesets.GetRuleset(0),
Metadata = new BeatmapMetadata
{
Title = @"Serendipity",
Artist = @"ZAQ",
},
BeatmapSetInfo = new BeatmapSetInfo
BeatmapSet = new BeatmapSetInfo
{
OnlineInfo = new BeatmapSetOnlineInfo
{

View File

@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual
{
BeatmapSetOnlineInfoId = 1234 + i,
Hash = "d8e8fca2dc0f896fd7cb4cb0031ba249",
BeatmapMetadata = new BeatmapMetadata
Metadata = new BeatmapMetadata
{
BeatmapSetOnlineInfoId = 1234 + i,
// Create random metadata, then we can check if sorting works based on these
@ -75,10 +75,10 @@ namespace osu.Game.Tests.Visual
new BeatmapInfo
{
BeatmapOnlineInfoId = 1234 + i,
RulesetInfo = rulesets.QueryRulesets().First(),
Ruleset = rulesets.QueryRulesets().First(),
Path = "normal.osu",
Version = "Normal",
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
OverallDifficulty = 3.5f,
}
@ -86,10 +86,10 @@ namespace osu.Game.Tests.Visual
new BeatmapInfo
{
BeatmapOnlineInfoId = 1235 + i,
RulesetInfo = rulesets.QueryRulesets().First(),
Ruleset = rulesets.QueryRulesets().First(),
Path = "hard.osu",
Version = "Hard",
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
OverallDifficulty = 5,
}
@ -97,10 +97,10 @@ namespace osu.Game.Tests.Visual
new BeatmapInfo
{
BeatmapOnlineInfoId = 1236 + i,
RulesetInfo = rulesets.QueryRulesets().First(),
Ruleset = rulesets.QueryRulesets().First(),
Path = "insane.osu",
Version = "Insane",
BeatmapDifficulty = new BeatmapDifficulty
Difficulty = new BeatmapDifficulty
{
OverallDifficulty = 7,
}

View File

@ -61,7 +61,7 @@ namespace osu.Game.Tests.Visual
{
var beatmap = CreateBeatmap();
beatmap.BeatmapInfo.RulesetInfo = r;
beatmap.BeatmapInfo.Ruleset = r;
var instance = r.CreateInstance();

View File

@ -32,14 +32,14 @@ namespace osu.Game.Tests.Visual
Value = new BeatmapInfo
{
StarDifficulty = 3.7,
RulesetInfo = rulesets.GetRuleset(3),
BeatmapMetadata = new BeatmapMetadata
Ruleset = rulesets.GetRuleset(3),
Metadata = new BeatmapMetadata
{
Title = @"Platina",
Artist = @"Maaya Sakamoto",
Author = @"uwutm8",
},
BeatmapSetInfo = new BeatmapSetInfo
BeatmapSet = new BeatmapSetInfo
{
OnlineInfo = new BeatmapSetOnlineInfo
{
@ -99,14 +99,14 @@ namespace osu.Game.Tests.Visual
Value = new BeatmapInfo
{
StarDifficulty = 7.07,
RulesetInfo = rulesets.GetRuleset(0),
BeatmapMetadata = new BeatmapMetadata
Ruleset = rulesets.GetRuleset(0),
Metadata = new BeatmapMetadata
{
Title = @"FREEDOM DIVE",
Artist = @"xi",
Author = @"Nakagawa-Kanon",
},
BeatmapSetInfo = new BeatmapSetInfo
BeatmapSet = new BeatmapSetInfo
{
OnlineInfo = new BeatmapSetOnlineInfo
{

View File

@ -48,8 +48,8 @@ namespace osu.Game.Tests.Visual
HitObjects = objects,
BeatmapInfo = new BeatmapInfo
{
BeatmapDifficulty = new BeatmapDifficulty(),
BeatmapMetadata = new BeatmapMetadata()
Difficulty = new BeatmapDifficulty(),
Metadata = new BeatmapMetadata()
}
};