mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 02:15:37 +08:00
Rename CheckUnsnaps
-> CheckUnsnappedObjects
Will potentially have `CheckUnsnappedKiai` or similar later, so this is worth specifying. Also consistent with `CheckConcurrentObjects`, which will likely have a `CheckConcurrentLines` later.
This commit is contained in:
parent
b9e4f73f78
commit
ce258febf6
@ -15,15 +15,15 @@ using osu.Game.Rulesets.Osu.Objects;
|
|||||||
namespace osu.Game.Tests.Editing.Checks
|
namespace osu.Game.Tests.Editing.Checks
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class CheckUnsnapsTest
|
public class CheckUnsnappedObjectsTest
|
||||||
{
|
{
|
||||||
private CheckUnsnaps check;
|
private CheckUnsnappedObjects check;
|
||||||
private ControlPointInfo cpi;
|
private ControlPointInfo cpi;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
check = new CheckUnsnaps();
|
check = new CheckUnsnappedObjects();
|
||||||
|
|
||||||
cpi = new ControlPointInfo();
|
cpi = new ControlPointInfo();
|
||||||
cpi.Add(100, new TimingControlPoint { BeatLength = 100 });
|
cpi.Add(100, new TimingControlPoint { BeatLength = 100 });
|
||||||
@ -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 CheckUnsnaps.IssueTemplate1MsOrMore));
|
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate1MsOrMore));
|
||||||
Assert.That(issues.Any(issue => issue.Template is CheckUnsnaps.IssueTemplate2MsOrMore));
|
Assert.That(issues.Any(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate2MsOrMore));
|
||||||
}
|
}
|
||||||
|
|
||||||
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 CheckUnsnaps.IssueTemplate1MsOrMore));
|
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate1MsOrMore));
|
||||||
}
|
}
|
||||||
|
|
||||||
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 CheckUnsnaps.IssueTemplate2MsOrMore));
|
Assert.That(issues.All(issue => issue.Template is CheckUnsnappedObjects.IssueTemplate2MsOrMore));
|
||||||
}
|
}
|
||||||
|
|
||||||
private IBeatmap getPlayableBeatmap(List<HitObject> hitobjects)
|
private IBeatmap getPlayableBeatmap(List<HitObject> hitobjects)
|
@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
new CheckAudioQuality(),
|
new CheckAudioQuality(),
|
||||||
|
|
||||||
// Compose
|
// Compose
|
||||||
new CheckUnsnaps(),
|
new CheckUnsnappedObjects(),
|
||||||
new CheckConcurrentObjects()
|
new CheckConcurrentObjects()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
public class CheckConcurrentObjects : ICheck
|
public class CheckConcurrentObjects : ICheck
|
||||||
{
|
{
|
||||||
// We guarantee that the objects are either treated as concurrent or unsnapped when near the same beat divisor.
|
// We guarantee that the objects are either treated as concurrent or unsnapped when near the same beat divisor.
|
||||||
private const double ms_leniency = CheckUnsnaps.UNSNAP_MS_THRESHOLD;
|
private const double ms_leniency = CheckUnsnappedObjects.UNSNAP_MS_THRESHOLD;
|
||||||
|
|
||||||
public CheckMetadata Metadata { get; } = new CheckMetadata(CheckCategory.Compose, "Concurrent hitobjects");
|
public CheckMetadata Metadata { get; } = new CheckMetadata(CheckCategory.Compose, "Concurrent hitobjects");
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ using osu.Game.Rulesets.Objects.Types;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Edit.Checks
|
namespace osu.Game.Rulesets.Edit.Checks
|
||||||
{
|
{
|
||||||
public class CheckUnsnaps : ICheck
|
public class CheckUnsnappedObjects : ICheck
|
||||||
{
|
{
|
||||||
public const double UNSNAP_MS_THRESHOLD = 2;
|
public const double UNSNAP_MS_THRESHOLD = 2;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user