osu/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs

64 lines
1.8 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 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-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;
using osu.Framework.Graphics.Containers;
2016-11-25 07:41:00 +00:00
using osu.Game.Modes;
namespace osu.Desktop.VisualTests.Tests
{
class TestCaseHitObjects : TestCase
{
public override string Name => @"Hit Objects";
public TestCaseHitObjects()
{
var swClock = new StopwatchClock(true) { Rate = 0.2f };
Clock = new FramedClock(swClock);
}
public override void Reset()
{
base.Reset();
Clock.ProcessFrame();
2016-11-29 19:50:12 +00:00
Container approachContainer = new Container { Depth = float.MinValue, };
Add(approachContainer);
2016-11-02 06:37:45 +00:00
const int count = 10;
for (int i = 0; i < count; i++)
{
2016-11-16 07:16:45 +00:00
var h = new HitCircle
{
StartTime = Clock.CurrentTime + 600 + i * 80,
2016-11-02 06:37:45 +00:00
Position = new Vector2((i - count / 2) * 14),
};
DrawableHitCircle d = new DrawableHitCircle(h)
{
Anchor = Anchor.Centre,
2016-11-29 19:50:12 +00:00
Depth = i,
State = ArmedState.Hit,
Judgement = new OsuJudgementInfo { Result = HitResult.Hit }
};
approachContainer.Add(d.ApproachCircle.CreateProxy());
Add(d);
}
}
}
}