mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Move ScoreInfo
string representation to extension method
This commit is contained in:
parent
4aee2844f6
commit
eba3cfc96e
@ -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)
|
||||
{
|
||||
|
15
osu.Game/Scoring/ScoreInfoExtensions.cs
Normal file
15
osu.Game/Scoring/ScoreInfoExtensions.cs
Normal 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()}";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user