2016-10-19 17:00:35 +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
|
|
|
|
|
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using System.Collections.Generic;
|
2016-10-19 17:00:35 +08:00
|
|
|
|
using osu.Framework.GameModes.Testing;
|
|
|
|
|
using osu.Framework.MathUtils;
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using osu.Framework.Timing;
|
2016-10-19 17:00:35 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.Objects;
|
|
|
|
|
using osu.Game.Beatmaps.Objects.Osu;
|
|
|
|
|
using osu.Game.GameModes.Play;
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using OpenTK;
|
2016-10-19 17:00:35 +08:00
|
|
|
|
|
2016-10-26 16:26:26 +08:00
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
2016-10-19 17:00:35 +08:00
|
|
|
|
{
|
|
|
|
|
class TestCasePlayer : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Name => @"Player";
|
|
|
|
|
|
|
|
|
|
public override string Description => @"Showing everything to play the game.";
|
|
|
|
|
|
|
|
|
|
FramedClock localClock;
|
|
|
|
|
|
|
|
|
|
protected override IFrameBasedClock Clock => localClock;
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
//ensure we are at offset 0
|
|
|
|
|
localClock = new FramedClock();
|
|
|
|
|
|
|
|
|
|
var objects = new List<HitObject>();
|
|
|
|
|
|
2016-10-19 18:44:03 +08:00
|
|
|
|
int time = 1500;
|
|
|
|
|
for (int i = 0; i < 50; i++)
|
2016-10-19 17:00:35 +08:00
|
|
|
|
{
|
|
|
|
|
objects.Add(new Circle()
|
|
|
|
|
{
|
|
|
|
|
StartTime = time,
|
2016-10-19 18:44:03 +08:00
|
|
|
|
Position = new Vector2(RNG.Next(100, 400), RNG.Next(100, 200))
|
2016-10-19 17:00:35 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
time += 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Add(new Player()
|
|
|
|
|
{
|
|
|
|
|
Beatmap = new Beatmap
|
|
|
|
|
{
|
|
|
|
|
HitObjects = objects
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
localClock.ProcessFrame();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|