2016-10-19 07:13:53 +00:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework;
|
|
|
|
|
using osu.Framework.GameModes.Testing;
|
|
|
|
|
using osu.Framework.Graphics;
|
2016-10-26 08:26:26 +00:00
|
|
|
|
using osu.Framework.Timing;
|
2016-11-02 03:22:22 +00:00
|
|
|
|
using OpenTK;
|
2016-11-08 23:13:20 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2016-11-14 09:03:20 +00:00
|
|
|
|
using osu.Game.Modes.Objects;
|
2016-11-14 10:49:29 +00:00
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
2016-11-14 09:54:24 +00:00
|
|
|
|
using osu.Game.Modes.Osu.Objects;
|
|
|
|
|
using osu.Game.Modes.Osu.Objects.Drawables;
|
2016-10-19 07:13:53 +00:00
|
|
|
|
|
2016-10-26 08:26:26 +00:00
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
2016-10-19 07:13:53 +00:00
|
|
|
|
{
|
|
|
|
|
class TestCaseHitObjects : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Name => @"Hit Objects";
|
|
|
|
|
|
|
|
|
|
IFrameBasedClock ourClock;
|
|
|
|
|
|
|
|
|
|
protected override IFrameBasedClock Clock => ourClock;
|
|
|
|
|
|
2016-11-12 17:34:36 +00:00
|
|
|
|
public TestCaseHitObjects()
|
2016-10-19 07:13:53 +00:00
|
|
|
|
{
|
|
|
|
|
var swClock = new StopwatchClock(true) { Rate = 1 };
|
|
|
|
|
ourClock = new FramedClock(swClock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
ourClock.ProcessFrame();
|
|
|
|
|
|
2016-11-02 06:37:45 +00:00
|
|
|
|
const int count = 10;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
2016-10-19 07:13:53 +00:00
|
|
|
|
{
|
2016-11-16 07:16:45 +00:00
|
|
|
|
var h = new HitCircle
|
2016-10-19 07:13:53 +00:00
|
|
|
|
{
|
|
|
|
|
StartTime = ourClock.CurrentTime + 1000 + i * 80,
|
2016-11-02 06:37:45 +00:00
|
|
|
|
Position = new Vector2((i - count / 2) * 14),
|
2016-10-19 07:13:53 +00:00
|
|
|
|
};
|
|
|
|
|
|
2016-11-16 07:20:58 +00:00
|
|
|
|
Add(new DrawableHitCircle(h)
|
2016-10-19 07:13:53 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Depth = -i,
|
2016-10-19 10:44:03 +00:00
|
|
|
|
State = ArmedState.Armed,
|
2016-10-19 07:13:53 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
ourClock.ProcessFrame();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|