1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 10:33:07 +08:00

1. fix TestCaseManiaHitObjects broken

2. add (4+4) (2+4+2) (1+8+1) column stages step in TestCaseManiaPlayfield
This commit is contained in:
ANDY840119-PC\andy840119 2018-01-03 23:47:05 +09:00
parent a855a21ccb
commit aadafae8cb
3 changed files with 43 additions and 8 deletions

View File

@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests
RelativeChildSize = new Vector2(1, 10000),
Children = new[]
{
new DrawableHoldNote(new HoldNote(), ManiaAction.Key1)
new DrawableHoldNote(new HoldNote(){Duration = 1000}, ManiaAction.Key1)
{
Y = 5000,
Height = 1000,

View File

@ -41,6 +41,36 @@ namespace osu.Game.Rulesets.Mania.Tests
AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right));
AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal));
AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal));
AddStep("4 + 4 columns", () =>
{
var stages = new List<StageDefinition>()
{
new StageDefinition() { Columns = 4 },
new StageDefinition() { Columns = 4 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
});
AddStep("2 + 4 + 2 columns", () =>
{
var stages = new List<StageDefinition>()
{
new StageDefinition() { Columns = 2 },
new StageDefinition() { Columns = 4 },
new StageDefinition() { Columns = 2 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
});
AddStep("1 + 1 + 8 columns", () =>
{
var stages = new List<StageDefinition>()
{
new StageDefinition() { Columns = 1 },
new StageDefinition() { Columns = 8 },
new StageDefinition() { Columns = 1 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
});
AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left));
AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right));
AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true));
@ -78,16 +108,22 @@ namespace osu.Game.Rulesets.Mania.Tests
private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false)
{
Clear();
var inputManager = new ManiaInputManager(maniaRuleset, cols) { RelativeSizeAxes = Axes.Both };
Add(inputManager);
ManiaPlayfield playfield;
var stages = new List<StageDefinition>()
{
new StageDefinition() { Columns = cols },
};
return createPlayfield(stages, specialPos, inverted);
}
private ManiaPlayfield createPlayfield(List<StageDefinition> stages, SpecialColumnPosition specialPos, bool inverted = false)
{
Clear();
var inputManager = new ManiaInputManager(maniaRuleset, stages.Sum(g => g.Columns)) { RelativeSizeAxes = Axes.Both };
Add(inputManager);
ManiaPlayfield playfield;
inputManager.Add(playfield = new ManiaPlayfield(stages)
{
Anchor = Anchor.Centre,

View File

@ -11,7 +11,6 @@ using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.Mods;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Replays;