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-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;
|
|
|
|
|
|
|
|
|
|
public override void Load(BaseGame game)
|
|
|
|
|
{
|
|
|
|
|
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,
|
|
|
|
|
Position = new OpenTK.Vector2(i * 14),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Add(new DrawableCircle(h)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|