Add notes to TestCaseColumn

This commit is contained in:
smoogipoo 2018-06-08 15:16:14 +09:00
parent 2a48e0e44a
commit d6f230f2b0
1 changed files with 38 additions and 7 deletions

View File

@ -7,6 +7,10 @@
using osu.Framework.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.Mania.UI.Components;
using osu.Game.Rulesets.UI.Scrolling;
@ -26,6 +30,8 @@ public class TestCaseColumn : ManiaInputTestCase
typeof(ColumnHitObjectArea)
};
private readonly List<Column> columns = new List<Column>();
public TestCaseColumn()
: base(2)
{
@ -48,13 +54,38 @@ private void load()
};
}
private Column createColumn(ScrollingDirection direction, ManiaAction action) => new Column(direction)
protected override void LoadComplete()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Height = 0.85f,
AccentColour = Color4.OrangeRed,
Action = action
};
base.LoadComplete();
AddStep("note", createNote);
}
private void createNote()
{
for (int i = 0; i < columns.Count; i++)
{
var obj = new Note { Column = i, StartTime = Time.Current + 2000 };
obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
columns[i].Add(new DrawableNote(obj, columns[i].Action));
}
}
private Column createColumn(ScrollingDirection direction, ManiaAction action)
{
var column = new Column(direction)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Height = 0.85f,
AccentColour = Color4.OrangeRed,
Action = action,
VisibleTimeRange = { Value = 2000 }
};
columns.Add(column);
return column;
}
}
}