1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 06:57:25 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs
2016-11-10 16:41:18 -05:00

64 lines
1.7 KiB
C#

//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;
using osu.Framework.Timing;
using osu.Game.Beatmaps.Objects;
using osu.Game.Beatmaps.Objects.Osu;
using osu.Game.Beatmaps.Objects.Osu.Drawable;
using OpenTK;
using osu.Framework.Allocation;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseHitObjects : TestCase
{
public override string Name => @"Hit Objects";
IFrameBasedClock ourClock;
protected override IFrameBasedClock Clock => ourClock;
[Initializer]
private void Load()
{
var swClock = new StopwatchClock(true) { Rate = 1 };
ourClock = new FramedClock(swClock);
}
public override void Reset()
{
base.Reset();
ourClock.ProcessFrame();
const int count = 10;
for (int i = 0; i < count; i++)
{
var h = new Circle
{
StartTime = ourClock.CurrentTime + 1000 + i * 80,
Position = new Vector2((i - count / 2) * 14),
};
Add(new DrawableCircle(h)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Depth = -i,
State = ArmedState.Armed,
});
}
}
protected override void Update()
{
base.Update();
ourClock.ProcessFrame();
}
}
}