Move legacy ScoreInfo to be completely based on presence of classic mod

This commit is contained in:
Dean Herbert
2021-06-08 18:00:09 +09:00
parent 4d9fffc01b
commit 061e3d7f26
3 changed files with 11 additions and 24 deletions

View File

@ -201,33 +201,12 @@ namespace osu.Game.Scoring
[JsonProperty("position")]
public int? Position { get; set; }
private bool isLegacyScore;
/// <summary>
/// Whether this <see cref="ScoreInfo"/> represents a legacy (osu!stable) score.
/// </summary>
[JsonIgnore]
[NotMapped]
public bool IsLegacyScore
{
get
{
if (isLegacyScore)
return true;
// The above check will catch legacy online scores that have an appropriate UserString + UserId.
// For non-online scores such as those imported in, a heuristic is used based on the following table:
//
// Mode | UserString | UserId
// --------------- | ---------- | ---------
// stable | <username> | 1
// lazer | <username> | <userid>
// lazer (offline) | Guest | 1
return ID > 0 && UserID == 1 && UserString != "Guest";
}
set => isLegacyScore = value;
}
public bool IsLegacyScore => mods.OfType<ModClassic>().Any();
public IEnumerable<HitResultDisplayStatistic> GetStatisticsForDisplay()
{