mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Initialise all parameters is paramaterless constructor for now for added safety
This commit is contained in:
parent
11ca1b6e7b
commit
744084b418
@ -31,11 +31,11 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public string DifficultyName { get; set; } = string.Empty;
|
||||
|
||||
public RulesetInfo Ruleset { get; set; } = null!;
|
||||
public RulesetInfo Ruleset { get; set; }
|
||||
|
||||
public BeatmapDifficulty Difficulty { get; set; } = new BeatmapDifficulty();
|
||||
public BeatmapDifficulty Difficulty { get; set; }
|
||||
|
||||
public BeatmapMetadata Metadata { get; set; } = new BeatmapMetadata();
|
||||
public BeatmapMetadata Metadata { get; set; }
|
||||
|
||||
[IgnoreMap]
|
||||
[Backlink(nameof(ScoreInfo.BeatmapInfo))]
|
||||
@ -51,6 +51,9 @@ namespace osu.Game.Beatmaps
|
||||
[UsedImplicitly]
|
||||
public BeatmapInfo() // TODO: consider removing this and migrating all usages to ctor with parameters.
|
||||
{
|
||||
Ruleset = new RulesetInfo();
|
||||
Difficulty = new BeatmapDifficulty();
|
||||
Metadata = new BeatmapMetadata();
|
||||
}
|
||||
|
||||
public BeatmapSetInfo? BeatmapSet { get; set; }
|
||||
|
@ -32,19 +32,33 @@ namespace osu.Game.Scoring
|
||||
[PrimaryKey]
|
||||
public Guid ID { get; set; } = Guid.NewGuid();
|
||||
|
||||
public BeatmapInfo BeatmapInfo { get; set; }
|
||||
|
||||
public RulesetInfo Ruleset { get; set; }
|
||||
|
||||
public IList<RealmNamedFileUsage> Files { get; } = null!;
|
||||
|
||||
public string Hash { get; set; } = string.Empty;
|
||||
|
||||
public bool DeletePending { get; set; }
|
||||
|
||||
public bool Equals(ScoreInfo other) => other.ID == ID;
|
||||
public long TotalScore { get; set; }
|
||||
|
||||
public int MaxCombo { get; set; }
|
||||
|
||||
public double Accuracy { get; set; }
|
||||
|
||||
public bool HasReplay { get; set; }
|
||||
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
public double? PP { get; set; }
|
||||
|
||||
[Indexed]
|
||||
public long OnlineID { get; set; } = -1;
|
||||
|
||||
[MapTo("User")]
|
||||
public RealmUser RealmUser { get; set; } = new RealmUser();
|
||||
public RealmUser RealmUser { get; set; }
|
||||
|
||||
[MapTo("Mods")]
|
||||
public string ModsJson { get; set; } = string.Empty;
|
||||
@ -62,6 +76,9 @@ namespace osu.Game.Scoring
|
||||
[UsedImplicitly]
|
||||
public ScoreInfo() // TODO: consider removing this and migrating all usages to ctor with parameters.
|
||||
{
|
||||
Ruleset = new RulesetInfo();
|
||||
RealmUser = new RealmUser();
|
||||
BeatmapInfo = new BeatmapInfo();
|
||||
}
|
||||
|
||||
// TODO: this is a bit temporary to account for the fact that this class is used to ferry API user data to certain UI components.
|
||||
@ -88,22 +105,6 @@ namespace osu.Game.Scoring
|
||||
}
|
||||
}
|
||||
|
||||
public long TotalScore { get; set; }
|
||||
|
||||
public int MaxCombo { get; set; }
|
||||
|
||||
public double Accuracy { get; set; }
|
||||
|
||||
public bool HasReplay { get; set; }
|
||||
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
public double? PP { get; set; }
|
||||
|
||||
public BeatmapInfo BeatmapInfo { get; set; } = null!;
|
||||
|
||||
public RulesetInfo Ruleset { get; set; } = null!;
|
||||
|
||||
public ScoreRank Rank
|
||||
{
|
||||
get => (ScoreRank)RankInt;
|
||||
@ -275,6 +276,8 @@ namespace osu.Game.Scoring
|
||||
|
||||
#endregion
|
||||
|
||||
public bool Equals(ScoreInfo other) => other.ID == ID;
|
||||
|
||||
public override string ToString() => this.GetDisplayTitle();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user