1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:02:59 +08:00

Formatting, ordering and simplification

This commit is contained in:
Dean Herbert 2019-01-25 11:13:37 +09:00
parent 490fb86f9e
commit 2a544f66ea

View File

@ -38,27 +38,33 @@ namespace osu.Game.Rulesets.Osu.Tests
typeof(DrawableSliderTail), typeof(DrawableSliderTail),
}; };
[SetUp] private const double time_before_slider = 250;
public void Setup() => Schedule(() => private const double time_slider_start = 1500;
{ private const double time_during_slide_1 = 2500;
allJudgedFired = false; private const double time_during_slide_2 = 3000;
judgementResults = new List<JudgementResult>(); private const double time_during_slide_3 = 3500;
}); private const double time_during_slide_4 = 4000;
private List<JudgementResult> judgementResults;
private bool allJudgedFired;
public TestCaseSliderInput() public TestCaseSliderInput()
{ {
Beatmap.Value = new TestWorkingBeatmap(new Beatmap<OsuHitObject> Beatmap.Value = new TestWorkingBeatmap(new Beatmap<OsuHitObject>
{ {
HitObjects = { new Slider HitObjects =
{ {
StartTime = time_slider_start, new Slider
Position = new Vector2(0, 0),
Path = new SliderPath(PathType.PerfectCurve, new[]
{ {
Vector2.Zero, StartTime = time_slider_start,
new Vector2(25, 0), Position = new Vector2(0, 0),
}, 25), Path = new SliderPath(PathType.PerfectCurve, new[]
}}, {
Vector2.Zero,
new Vector2(25, 0),
}, 25),
}
},
ControlPointInfo = ControlPointInfo =
{ {
DifficultyPoints = { new DifficultyControlPoint { SpeedMultiplier = 0.1f } } DifficultyPoints = { new DifficultyControlPoint { SpeedMultiplier = 0.1f } }
@ -73,15 +79,13 @@ namespace osu.Game.Rulesets.Osu.Tests
AddUntilStep(() => Beatmap.Value.BeatmapLoaded, "Wait for bm load"); AddUntilStep(() => Beatmap.Value.BeatmapLoaded, "Wait for bm load");
} }
private const double time_before_slider = 250; [SetUp]
private const double time_slider_start = 1500; public void Setup() => Schedule(() =>
private const double time_during_slide_1 = 2500; {
private const double time_during_slide_2 = 3000; allJudgedFired = false;
private const double time_during_slide_3 = 3500; judgementResults = new List<JudgementResult>();
private const double time_during_slide_4 = 4000; });
private List<JudgementResult> judgementResults;
private bool allJudgedFired;
/// <summary> /// <summary>
/// Scenario: /// Scenario:
/// - Press a key before a slider starts /// - Press a key before a slider starts
@ -392,16 +396,14 @@ namespace osu.Game.Rulesets.Osu.Tests
// Empty frame to be added as a workaround for first frame behavior. // Empty frame to be added as a workaround for first frame behavior.
// If an input exists on the first frame, the input would apply to the entire intro lead-in // If an input exists on the first frame, the input would apply to the entire intro lead-in
// Likely requires some discussion regarding how first frame inputs should be handled. // Likely requires some discussion regarding how first frame inputs should be handled.
frames.Insert(0, new OsuReplayFrame { Position = new Vector2(0, 0), Time = 0, Actions = new List<OsuAction>() }); frames.Insert(0, new OsuReplayFrame());
var player = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }) LoadComponentAsync(new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } })
{ {
AllowPause = false, AllowPause = false,
AllowLeadIn = false, AllowLeadIn = false,
AllowResults = false AllowResults = false
}; }, p =>
LoadComponentAsync(player, p =>
{ {
Child = p; Child = p;
p.ScoreProcessor.NewJudgement += result => judgementResults.Add(result); p.ScoreProcessor.NewJudgement += result => judgementResults.Add(result);