1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Ensure BeatmapInfo Difficulty and Metadata is non-null

This commit is contained in:
Dean Herbert 2022-01-10 19:23:43 +09:00
parent a7958b1d31
commit 6033a825ed

View File

@ -32,9 +32,21 @@ namespace osu.Game.Beatmaps
public RulesetInfo Ruleset { get; set; } = null!;
public BeatmapDifficulty Difficulty { get; set; } = null!;
public BeatmapDifficulty Difficulty { get; set; } = new BeatmapDifficulty();
public BeatmapMetadata Metadata { get; set; } = null!;
public BeatmapMetadata Metadata { get; set; } = new BeatmapMetadata();
public BeatmapInfo(RulesetInfo ruleset, BeatmapDifficulty difficulty, BeatmapMetadata metadata)
{
Ruleset = ruleset;
Difficulty = difficulty;
Metadata = metadata;
}
[UsedImplicitly]
public BeatmapInfo() // TODO: this bypasses null safeties. needs to be hidden from user api (only should be used by realm).
{
}
public BeatmapSetInfo? BeatmapSet { get; set; }
@ -66,18 +78,6 @@ namespace osu.Game.Beatmaps
[JsonIgnore]
public bool Hidden { get; set; }
public BeatmapInfo(RulesetInfo ruleset, BeatmapDifficulty difficulty, BeatmapMetadata metadata)
{
Ruleset = ruleset;
Difficulty = difficulty;
Metadata = metadata;
}
[UsedImplicitly]
public BeatmapInfo() // TODO: this bypasses null safeties. needs to be hidden from user api (only should be used by realm).
{
}
#region Properties we may not want persisted (but also maybe no harm?)
public double AudioLeadIn { get; set; }