2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-19 15:13:53 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework;
|
|
|
|
|
using osu.Framework.GameModes.Testing;
|
|
|
|
|
using osu.Framework.Graphics;
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using osu.Framework.Timing;
|
2016-11-02 11:22:22 +08:00
|
|
|
|
using OpenTK;
|
2016-11-09 07:13:20 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes.Objects;
|
2016-11-14 18:49:29 +08:00
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Modes.Osu.Objects;
|
|
|
|
|
using osu.Game.Modes.Osu.Objects.Drawables;
|
2016-11-19 18:07:57 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2016-11-25 15:41:00 +08:00
|
|
|
|
using osu.Game.Modes;
|
2016-10-19 15:13:53 +08:00
|
|
|
|
|
2016-10-26 16:26:26 +08:00
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
|
|
|
|
class TestCaseHitObjects : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Name => @"Hit Objects";
|
|
|
|
|
|
2016-11-13 01:34:36 +08:00
|
|
|
|
public TestCaseHitObjects()
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
2016-12-07 17:18:36 +08:00
|
|
|
|
var swClock = new StopwatchClock(true) { Rate = 0.2f };
|
2016-11-20 19:16:54 +08:00
|
|
|
|
Clock = new FramedClock(swClock);
|
2016-10-19 15:13:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
2016-11-20 19:16:54 +08:00
|
|
|
|
Clock.ProcessFrame();
|
2016-10-19 15:13:53 +08:00
|
|
|
|
|
2016-11-30 03:50:12 +08:00
|
|
|
|
Container approachContainer = new Container { Depth = float.MinValue, };
|
2016-11-19 18:07:57 +08:00
|
|
|
|
|
|
|
|
|
Add(approachContainer);
|
|
|
|
|
|
2016-11-02 14:37:45 +08:00
|
|
|
|
const int count = 10;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
2016-11-16 15:16:45 +08:00
|
|
|
|
var h = new HitCircle
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
2017-01-24 17:12:02 +08:00
|
|
|
|
StartTime = Clock.CurrentTime + 600 + i * 80,
|
2016-11-02 14:37:45 +08:00
|
|
|
|
Position = new Vector2((i - count / 2) * 14),
|
2016-10-19 15:13:53 +08:00
|
|
|
|
};
|
|
|
|
|
|
2016-11-19 18:07:57 +08:00
|
|
|
|
DrawableHitCircle d = new DrawableHitCircle(h)
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
2016-11-30 03:50:12 +08:00
|
|
|
|
Depth = i,
|
2016-11-25 15:26:50 +08:00
|
|
|
|
State = ArmedState.Hit,
|
2016-12-07 17:18:36 +08:00
|
|
|
|
Judgement = new OsuJudgementInfo { Result = HitResult.Hit }
|
2016-11-19 18:07:57 +08:00
|
|
|
|
};
|
|
|
|
|
|
2016-12-07 17:18:36 +08:00
|
|
|
|
|
2016-11-19 18:07:57 +08:00
|
|
|
|
approachContainer.Add(d.ApproachCircle.CreateProxy());
|
|
|
|
|
Add(d);
|
2016-10-19 15:13:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|