1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 10:47:24 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs

68 lines
1.9 KiB
C#
Raw Normal View History

//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 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;
using osu.Framework.Graphics.Containers;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseHitObjects : TestCase
{
public override string Name => @"Hit Objects";
public TestCaseHitObjects()
{
var swClock = new StopwatchClock(true) { Rate = 1 };
Clock = new FramedClock(swClock);
}
public override void Reset()
{
base.Reset();
Clock.ProcessFrame();
Container approachContainer = new Container { Depth = float.MaxValue, };
Add(approachContainer);
2016-11-02 14:37:45 +08:00
const int count = 10;
for (int i = 0; i < count; i++)
{
2016-11-16 15:16:45 +08:00
var h = new HitCircle
{
StartTime = Clock.CurrentTime + 1000 + i * 80,
2016-11-02 14:37:45 +08:00
Position = new Vector2((i - count / 2) * 14),
};
DrawableHitCircle d = new DrawableHitCircle(h)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Depth = -i,
State = ArmedState.Armed,
};
approachContainer.Add(d.ApproachCircle.CreateProxy());
Add(d);
}
}
protected override void Update()
{
base.Update();
Clock.ProcessFrame();
}
}
}