2016-10-19 15:13:53 +08: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 16:26:26 +08:00
|
|
|
|
using osu.Framework.Timing;
|
|
|
|
|
using osu.Game.Beatmaps.Objects;
|
2016-10-19 15:13:53 +08:00
|
|
|
|
using osu.Game.Beatmaps.Objects.Osu;
|
|
|
|
|
using osu.Game.Beatmaps.Objects.Osu.Drawable;
|
2016-11-02 11:22:22 +08:00
|
|
|
|
using OpenTK;
|
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";
|
|
|
|
|
|
|
|
|
|
IFrameBasedClock ourClock;
|
|
|
|
|
|
|
|
|
|
protected override IFrameBasedClock Clock => ourClock;
|
|
|
|
|
|
2016-11-01 22:24:14 +08:00
|
|
|
|
protected override void Load(BaseGame game)
|
2016-10-19 15:13:53 +08:00
|
|
|
|
{
|
|
|
|
|
base.Load(game);
|
|
|
|
|
|
|
|
|
|
var swClock = new StopwatchClock(true) { Rate = 1 };
|
|
|
|
|
ourClock = new FramedClock(swClock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
ourClock.ProcessFrame();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 20; i++)
|
|
|
|
|
{
|
|
|
|
|
var h = new Circle
|
|
|
|
|
{
|
|
|
|
|
StartTime = ourClock.CurrentTime + 1000 + i * 80,
|
2016-11-02 11:22:22 +08:00
|
|
|
|
Position = new Vector2(i * 14),
|
2016-10-19 15:13:53 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Add(new DrawableCircle(h)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2016-11-02 11:22:22 +08:00
|
|
|
|
Scale = new Vector2(1.2f),
|
2016-10-19 15:13:53 +08:00
|
|
|
|
Depth = -i,
|
2016-10-19 18:44:03 +08:00
|
|
|
|
State = ArmedState.Armed,
|
2016-10-19 15:13:53 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
ourClock.ProcessFrame();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|