mirror of
https://github.com/ppy/osu
synced 2025-01-16 02:51:20 +00:00
Use local variables for common sample lists
This commit is contained in:
parent
9f9e96ce9e
commit
1dbac76da5
@ -20,10 +20,19 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
{
|
||||
private CheckFewHitsounds check;
|
||||
|
||||
private List<HitSampleInfo> notHitsounded;
|
||||
private List<HitSampleInfo> hitsounded;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
check = new CheckFewHitsounds();
|
||||
notHitsounded = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
hitsounded = new List<HitSampleInfo>
|
||||
{
|
||||
new HitSampleInfo(HitSampleInfo.HIT_NORMAL),
|
||||
new HitSampleInfo(HitSampleInfo.HIT_FINISH)
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -80,10 +89,7 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
|
||||
for (int i = 0; i < 30; ++i)
|
||||
{
|
||||
var samples = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
|
||||
if (i % 8 == 0)
|
||||
samples.Add(new HitSampleInfo(HitSampleInfo.HIT_WHISTLE));
|
||||
var samples = i % 8 == 0 ? hitsounded : notHitsounded;
|
||||
|
||||
hitObjects.Add(new HitCircle { StartTime = 1000 * i, Samples = samples });
|
||||
}
|
||||
@ -98,10 +104,7 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
|
||||
for (int i = 0; i < 30; ++i)
|
||||
{
|
||||
var samples = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
|
||||
if (i == 0 || i == 15)
|
||||
samples.Add(new HitSampleInfo(HitSampleInfo.HIT_WHISTLE));
|
||||
var samples = (i == 0 || i == 15) ? hitsounded : notHitsounded;
|
||||
|
||||
hitObjects.Add(new HitCircle { StartTime = 1000 * i, Samples = samples });
|
||||
}
|
||||
@ -117,10 +120,7 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
|
||||
for (int i = 0; i < 80; ++i)
|
||||
{
|
||||
var samples = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
|
||||
if (i == 40)
|
||||
samples.Add(new HitSampleInfo(HitSampleInfo.HIT_WHISTLE));
|
||||
var samples = i == 40 ? hitsounded : notHitsounded;
|
||||
|
||||
hitObjects.Add(new HitCircle { StartTime = 1000 * i, Samples = samples });
|
||||
}
|
||||
@ -135,11 +135,7 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
var hitObjects = new List<HitObject>();
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
var samples = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
|
||||
hitObjects.Add(new HitCircle { StartTime = 1000 * i, Samples = samples });
|
||||
}
|
||||
hitObjects.Add(new HitCircle { StartTime = 1000 * i, Samples = notHitsounded });
|
||||
|
||||
assertNoHitsounds(hitObjects);
|
||||
}
|
||||
@ -149,13 +145,6 @@ namespace osu.Game.Tests.Editing.Checks
|
||||
{
|
||||
var hitObjects = new List<HitObject>();
|
||||
|
||||
var notHitsounded = new List<HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) };
|
||||
var hitsounded = new List<HitSampleInfo>
|
||||
{
|
||||
new HitSampleInfo(HitSampleInfo.HIT_NORMAL),
|
||||
new HitSampleInfo(HitSampleInfo.HIT_FINISH)
|
||||
};
|
||||
|
||||
var ticks = new List<HitObject>();
|
||||
for (int i = 1; i < 10; ++i)
|
||||
ticks.Add(new SliderTick { StartTime = 5000 * i, Samples = hitsounded });
|
||||
|
Loading…
Reference in New Issue
Block a user