mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Include PropertyName in PerformanceDisplayAttribute
This commit is contained in:
parent
d014fef179
commit
b81fc675e8
@ -23,8 +23,8 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
foreach (var attribute in base.GetAttributesForDisplay())
|
||||
yield return attribute;
|
||||
|
||||
yield return new PerformanceDisplayAttribute("Difficulty", Difficulty);
|
||||
yield return new PerformanceDisplayAttribute("Accuracy", Accuracy);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Difficulty), "Difficulty", Difficulty);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Accuracy), "Accuracy", Accuracy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,10 +29,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
foreach (var attribute in base.GetAttributesForDisplay())
|
||||
yield return attribute;
|
||||
|
||||
yield return new PerformanceDisplayAttribute("Aim", Aim);
|
||||
yield return new PerformanceDisplayAttribute("Speed", Speed);
|
||||
yield return new PerformanceDisplayAttribute("Accuracy", Accuracy);
|
||||
yield return new PerformanceDisplayAttribute("Flashlight Bonus", Flashlight);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Aim), "Aim", Aim);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Speed), "Speed", Speed);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Accuracy), "Accuracy", Accuracy);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Flashlight), "Flashlight Bonus", Flashlight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
||||
foreach (var attribute in base.GetAttributesForDisplay())
|
||||
yield return attribute;
|
||||
|
||||
yield return new PerformanceDisplayAttribute("Difficulty", Difficulty);
|
||||
yield return new PerformanceDisplayAttribute("Accuracy", Accuracy);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Difficulty), "Difficulty", Difficulty);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Accuracy), "Accuracy", Accuracy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
/// <returns></returns>
|
||||
public virtual IEnumerable<PerformanceDisplayAttribute> GetAttributesForDisplay()
|
||||
{
|
||||
yield return new PerformanceDisplayAttribute("Total", Total);
|
||||
yield return new PerformanceDisplayAttribute(nameof(Total), "Total", Total);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,11 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
/// </summary>
|
||||
public class PerformanceDisplayAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the attribute property in <see cref="PerformanceAttributes"/>.
|
||||
/// </summary>
|
||||
public string PropertyName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A custom display name for the attribute.
|
||||
/// </summary>
|
||||
@ -17,8 +22,9 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
/// </summary>
|
||||
public double Value { get; }
|
||||
|
||||
public PerformanceDisplayAttribute(string displayName, double value)
|
||||
public PerformanceDisplayAttribute(string propertyName, string displayName, double value)
|
||||
{
|
||||
PropertyName = propertyName;
|
||||
DisplayName = displayName;
|
||||
Value = value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user