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
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using osu.Framework.GameModes.Testing;
|
|
|
|
|
using osu.Framework.MathUtils;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.Objects;
|
|
|
|
|
using osu.Game.Beatmaps.Objects.Osu;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Timing;
|
|
|
|
|
using osu.Game.GameModes.Play;
|
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.Tests
|
|
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|