mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Cache StageDefinition
for consumption (and remove ColumnType
)
This commit is contained in:
52
osu.Game.Rulesets.Mania.Tests/ManiaSpecialColumnTest.cs
Normal file
52
osu.Game.Rulesets.Mania.Tests/ManiaSpecialColumnTest.cs
Normal file
@ -0,0 +1,52 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class ManiaSpecialColumnTest
|
||||
{
|
||||
[TestCase(new[]
|
||||
{
|
||||
true
|
||||
}, 1)]
|
||||
[TestCase(new[]
|
||||
{
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
}, 4)]
|
||||
[TestCase(new[]
|
||||
{
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
}, 7)]
|
||||
public void Test(IEnumerable<bool> special, int columns)
|
||||
{
|
||||
var definition = new StageDefinition
|
||||
{
|
||||
Columns = columns
|
||||
};
|
||||
var results = getResults(definition);
|
||||
Assert.AreEqual(special, results);
|
||||
}
|
||||
|
||||
private IEnumerable<bool> getResults(StageDefinition definition)
|
||||
{
|
||||
for (int i = 0; i < definition.Columns; i++)
|
||||
yield return definition.IsSpecialColumn(i);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user