1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Change some methods to get properties

This commit is contained in:
Dean Herbert 2021-04-12 15:37:41 +09:00
parent f78239c7f2
commit 8c31e96cdf
5 changed files with 6 additions and 9 deletions

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Checks
description: "Offscreen hitobjects." description: "Offscreen hitobjects."
); );
public override IEnumerable<IssueTemplate> Templates() => new[] public override IEnumerable<IssueTemplate> PossibleTemplates => new[]
{ {
templateOffscreen, templateOffscreen,
templateOffscreenSliderPath templateOffscreenSliderPath

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Edit.Checks
description: "Missing background." description: "Missing background."
); );
public override IEnumerable<IssueTemplate> Templates() => new[] public override IEnumerable<IssueTemplate> PossibleTemplates => new[]
{ {
templateNoneSet, templateNoneSet,
templateDoesNotExist templateDoesNotExist

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
/// <summary> /// <summary>
/// All possible templates for issues that this check may return. /// All possible templates for issues that this check may return.
/// </summary> /// </summary>
public abstract IEnumerable<IssueTemplate> Templates(); public abstract IEnumerable<IssueTemplate> PossibleTemplates { get; }
/// <summary> /// <summary>
/// Runs this check and returns any issues detected for the provided beatmap. /// Runs this check and returns any issues detected for the provided beatmap.
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
protected Check() protected Check()
{ {
foreach (var template in Templates()) foreach (var template in PossibleTemplates)
template.Origin = this; template.Origin = this;
} }
} }

View File

@ -69,10 +69,7 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
HitObjects = hitObjectList; HitObjects = hitObjectList;
} }
public override string ToString() public override string ToString() => Template.GetMessage(Arguments);
{
return Template.Message(Arguments);
}
public string GetEditorTimestamp() public string GetEditorTimestamp()
{ {

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
/// Returns the formatted message given the arguments used to format it. /// Returns the formatted message given the arguments used to format it.
/// </summary> /// </summary>
/// <param name="args">The arguments used to format the message.</param> /// <param name="args">The arguments used to format the message.</param>
public string Message(params object[] args) => UnformattedMessage.FormatWith(args); public string GetMessage(params object[] args) => UnformattedMessage.FormatWith(args);
/// <summary> /// <summary>
/// Returns the colour corresponding to the type of this issue. /// Returns the colour corresponding to the type of this issue.