mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:42:57 +08:00
Ensure BeatmapInfo
Difficulty
and Metadata
is non-null
This commit is contained in:
parent
a7958b1d31
commit
6033a825ed
@ -32,9 +32,21 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public RulesetInfo Ruleset { get; set; } = null!;
|
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; }
|
public BeatmapSetInfo? BeatmapSet { get; set; }
|
||||||
|
|
||||||
@ -66,18 +78,6 @@ namespace osu.Game.Beatmaps
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool Hidden { get; set; }
|
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?)
|
#region Properties we may not want persisted (but also maybe no harm?)
|
||||||
|
|
||||||
public double AudioLeadIn { get; set; }
|
public double AudioLeadIn { get; set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user