1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Rename unsnap check templates

This commit is contained in:
Naxess 2021-04-27 13:56:05 +02:00
parent 7a6e9e5070
commit 200352b750
2 changed files with 12 additions and 12 deletions

View File

@ -108,8 +108,8 @@ namespace osu.Game.Tests.Editing.Checks
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
Assert.That(issues, Has.Count.EqualTo(2));
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate1MsOrMore));
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate2MsOrMore));
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplateSmallUnsnap));
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplateLargeUnsnap));
}
private Mock<Slider> getSliderMock(double startTime, double endTime, int repeats = 0)
@ -132,7 +132,7 @@ namespace osu.Game.Tests.Editing.Checks
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
Assert.That(issues, Has.Count.EqualTo(count));
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate1MsOrMore));
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplateSmallUnsnap));
}
private void assert2Ms(List<HitObject> hitobjects, int count = 1)
@ -140,7 +140,7 @@ namespace osu.Game.Tests.Editing.Checks
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
Assert.That(issues, Has.Count.EqualTo(count));
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate2MsOrMore));
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplateLargeUnsnap));
}
private IBeatmap getPlayableBeatmap(List<HitObject> hitobjects)

View File

@ -18,8 +18,8 @@ namespace osu.Game.Rulesets.Edit.Checks
public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[]
{
new IssueTemplate2MsOrMore(this),
new IssueTemplate1MsOrMore(this)
new IssueTemplateLargeUnsnap(this),
new IssueTemplateSmallUnsnap(this)
};
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, IWorkingBeatmap workingBeatmap)
@ -55,9 +55,9 @@ namespace osu.Game.Rulesets.Edit.Checks
private IEnumerable<Issue> getUnsnapIssues(HitObject hitobject, double unsnap, double time, string postfix = "")
{
if (Math.Abs(unsnap) >= UNSNAP_MS_THRESHOLD)
yield return new IssueTemplate2MsOrMore(this).Create(hitobject, unsnap, time, postfix);
yield return new IssueTemplateLargeUnsnap(this).Create(hitobject, unsnap, time, postfix);
else if (Math.Abs(unsnap) >= 1)
yield return new IssueTemplate1MsOrMore(this).Create(hitobject, unsnap, time, postfix);
yield return new IssueTemplateSmallUnsnap(this).Create(hitobject, unsnap, time, postfix);
// We don't care about unsnaps < 1 ms, as all object ends have these due to the way SV works.
}
@ -79,17 +79,17 @@ namespace osu.Game.Rulesets.Edit.Checks
}
}
public class IssueTemplate2MsOrMore : IssueTemplateUnsnap
public class IssueTemplateLargeUnsnap : IssueTemplateUnsnap
{
public IssueTemplate2MsOrMore(ICheck check)
public IssueTemplateLargeUnsnap(ICheck check)
: base(check, IssueType.Problem)
{
}
}
public class IssueTemplate1MsOrMore : IssueTemplateUnsnap
public class IssueTemplateSmallUnsnap : IssueTemplateUnsnap
{
public IssueTemplate1MsOrMore(ICheck check)
public IssueTemplateSmallUnsnap(ICheck check)
: base(check, IssueType.Negligible)
{
}