1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 12:53:11 +08:00

Move ScoreInfo string representation to extension method

This commit is contained in:
Bartłomiej Dach 2021-11-09 12:37:12 +01:00
parent 4aee2844f6
commit eba3cfc96e
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 16 additions and 1 deletions

View File

@ -225,7 +225,7 @@ namespace osu.Game.Scoring
return clone;
}
public override string ToString() => $"{User} playing {BeatmapInfo}";
public override string ToString() => this.GetDisplayTitle();
public bool Equals(ScoreInfo other)
{

View File

@ -0,0 +1,15 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
namespace osu.Game.Scoring
{
public static class ScoreInfoExtensions
{
/// <summary>
/// A user-presentable display title representing this score.
/// </summary>
public static string GetDisplayTitle(this IScoreInfo scoreInfo) => $"{scoreInfo.User.Username} playing {scoreInfo.Beatmap.GetDisplayTitle()}";
}
}