mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 07:22:55 +08:00
Merge remote-tracking branch 'smoogipooo/remove-playmode' into better-conversion
This commit is contained in:
commit
1be1683a4f
@ -154,7 +154,15 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
Assert.IsTrue(set.Beatmaps.Count > 0);
|
Assert.IsTrue(set.Beatmaps.Count > 0);
|
||||||
|
|
||||||
var beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap;
|
var beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap;
|
||||||
|
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
|
||||||
|
|
||||||
|
beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 1))?.Beatmap;
|
||||||
|
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
|
||||||
|
|
||||||
|
beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 2))?.Beatmap;
|
||||||
|
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
|
||||||
|
|
||||||
|
beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 3))?.Beatmap;
|
||||||
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
|
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,10 +219,9 @@ namespace osu.Game.Database
|
|||||||
beatmap.BeatmapInfo.Metadata = null;
|
beatmap.BeatmapInfo.Metadata = null;
|
||||||
|
|
||||||
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
||||||
|
beatmap.BeatmapInfo.Ruleset = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID);
|
||||||
beatmap.BeatmapInfo.StarDifficulty = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0;
|
beatmap.BeatmapInfo.StarDifficulty = rulesets.Query<RulesetInfo>().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0;
|
||||||
|
|
||||||
beatmap.BeatmapInfo.Ruleset = null;
|
|
||||||
|
|
||||||
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
||||||
}
|
}
|
||||||
beatmapSet.StoryboardFile = archive.StoryboardFilename;
|
beatmapSet.StoryboardFile = archive.StoryboardFilename;
|
||||||
@ -239,7 +238,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
foreach (var s in beatmapSets)
|
foreach (var s in beatmapSets)
|
||||||
{
|
{
|
||||||
Connection.InsertWithChildren(s, true);
|
Connection.InsertOrReplaceWithChildren(s, true);
|
||||||
BeatmapSetAdded?.Invoke(s);
|
BeatmapSetAdded?.Invoke(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,10 @@ namespace osu.Game.Database
|
|||||||
[PrimaryKey, AutoIncrement]
|
[PrimaryKey, AutoIncrement]
|
||||||
public int? ID { get; set; }
|
public int? ID { get; set; }
|
||||||
|
|
||||||
|
[Indexed(Unique = true)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[Indexed(Unique = true)]
|
||||||
public string InstantiationInfo { get; set; }
|
public string InstantiationInfo { get; set; }
|
||||||
|
|
||||||
[Indexed]
|
[Indexed]
|
||||||
|
Loading…
Reference in New Issue
Block a user