From 8d4a211419856475b2c777928544940051e50120 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 19 Oct 2016 13:13:14 -0400 Subject: [PATCH] Fix initialization of BeatmapInfo --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 6 +++++- osu.Game/Database/BeatmapDatabase.cs | 1 + osu.Game/Database/BeatmapInfo.cs | 8 ++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 78f05676b7..7d3b918961 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -214,7 +214,11 @@ namespace osu.Game.Beatmaps.Formats HitObjects = new List(), ControlPoints = new List(), ComboColors = new List(), - BeatmapInfo = new BeatmapInfo(), + BeatmapInfo = new BeatmapInfo + { + Metadata = new BeatmapMetadata(), + BaseDifficulty = new BaseDifficulty(), + }, }; var section = Section.None; diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 0378421411..4d980283f6 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index 3dd45a0c2b..996a887e77 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -9,16 +9,12 @@ namespace osu.Game.Database { public class BeatmapInfo { - public BeatmapInfo() - { - BaseDifficulty = new BaseDifficulty(); - Metadata = new BeatmapMetadata(); - } - [PrimaryKey] public int BeatmapID { get; set; } [ForeignKey(typeof(BeatmapSetInfo)), NotNull] public int BeatmapSetID { get; set; } + [ManyToOne] + public BeatmapSetInfo BeatmapSet { get; set; } [ForeignKey(typeof(BeatmapMetadata))] public int BeatmapMetadataID { get; set; } [ForeignKey(typeof(BaseDifficulty)), NotNull]