mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Rename unsnap check templates
This commit is contained in:
parent
7a6e9e5070
commit
200352b750
@ -108,8 +108,8 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
|
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
|
||||||
|
|
||||||
Assert.That(issues, Has.Count.EqualTo(2));
|
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.IssueTemplateSmallUnsnap));
|
||||||
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate2MsOrMore));
|
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplateLargeUnsnap));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Mock<Slider> getSliderMock(double startTime, double endTime, int repeats = 0)
|
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();
|
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
|
||||||
|
|
||||||
Assert.That(issues, Has.Count.EqualTo(count));
|
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)
|
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();
|
var issues = check.Run(getPlayableBeatmap(hitobjects), null).ToList();
|
||||||
|
|
||||||
Assert.That(issues, Has.Count.EqualTo(count));
|
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)
|
private IBeatmap getPlayableBeatmap(List<HitObject> hitobjects)
|
||||||
|
@ -18,8 +18,8 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
|
|
||||||
public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[]
|
public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[]
|
||||||
{
|
{
|
||||||
new IssueTemplate2MsOrMore(this),
|
new IssueTemplateLargeUnsnap(this),
|
||||||
new IssueTemplate1MsOrMore(this)
|
new IssueTemplateSmallUnsnap(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, IWorkingBeatmap workingBeatmap)
|
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 = "")
|
private IEnumerable<Issue> getUnsnapIssues(HitObject hitobject, double unsnap, double time, string postfix = "")
|
||||||
{
|
{
|
||||||
if (Math.Abs(unsnap) >= UNSNAP_MS_THRESHOLD)
|
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)
|
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.
|
// 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)
|
: base(check, IssueType.Problem)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IssueTemplate1MsOrMore : IssueTemplateUnsnap
|
public class IssueTemplateSmallUnsnap : IssueTemplateUnsnap
|
||||||
{
|
{
|
||||||
public IssueTemplate1MsOrMore(ICheck check)
|
public IssueTemplateSmallUnsnap(ICheck check)
|
||||||
: base(check, IssueType.Negligible)
|
: base(check, IssueType.Negligible)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user