2016-09-02 17:06:36 +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-09-25 12:59:38 +08:00
|
|
|
|
using osu.Framework.GameModes.Testing;
|
|
|
|
|
using osu.Framework.Graphics;
|
2016-09-02 19:30:27 +08:00
|
|
|
|
using osu.Framework.MathUtils;
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using osu.Framework.Timing;
|
2016-09-02 17:27:38 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes.Catch;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Modes.Catch.UI;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes.Mania;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Modes.Mania.UI;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes.Objects;
|
|
|
|
|
using osu.Game.Modes.Osu;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Modes.Osu.Objects;
|
|
|
|
|
using osu.Game.Modes.Osu.UI;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes.Taiko;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Modes.Taiko.UI;
|
2016-10-26 16:26:26 +08:00
|
|
|
|
using OpenTK;
|
2016-09-02 17:06:36 +08:00
|
|
|
|
|
2016-10-26 16:26:26 +08:00
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
2016-09-02 17:06:36 +08:00
|
|
|
|
{
|
2016-09-25 12:59:38 +08:00
|
|
|
|
class TestCaseGamefield : TestCase
|
2016-09-02 17:06:36 +08:00
|
|
|
|
{
|
2016-09-25 12:59:38 +08:00
|
|
|
|
public override string Name => @"Gamefield";
|
|
|
|
|
|
|
|
|
|
public override string Description => @"Showing hitobjects and what not.";
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
2016-09-02 17:06:36 +08:00
|
|
|
|
{
|
2016-09-25 12:59:38 +08:00
|
|
|
|
base.Reset();
|
|
|
|
|
|
2016-10-01 17:40:14 +08:00
|
|
|
|
//ensure we are at offset 0
|
2016-11-20 19:16:54 +08:00
|
|
|
|
Clock = new FramedClock();
|
2016-09-02 17:27:38 +08:00
|
|
|
|
|
2016-09-26 14:07:29 +08:00
|
|
|
|
List<HitObject> objects = new List<HitObject>();
|
2016-09-02 19:30:27 +08:00
|
|
|
|
|
2016-09-25 12:59:38 +08:00
|
|
|
|
int time = 500;
|
2016-09-02 19:30:27 +08:00
|
|
|
|
for (int i = 0; i < 100; i++)
|
2016-09-02 17:27:38 +08:00
|
|
|
|
{
|
2016-11-16 15:16:45 +08:00
|
|
|
|
objects.Add(new HitCircle()
|
2016-09-02 18:25:13 +08:00
|
|
|
|
{
|
2016-09-02 19:30:27 +08:00
|
|
|
|
StartTime = time,
|
2016-12-11 17:11:22 +08:00
|
|
|
|
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)),
|
|
|
|
|
Scale = RNG.NextSingle(0.5f, 1.0f),
|
2016-09-02 19:30:27 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
time += RNG.Next(50, 500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Beatmap beatmap = new Beatmap
|
|
|
|
|
{
|
|
|
|
|
HitObjects = objects
|
2016-09-02 17:27:38 +08:00
|
|
|
|
};
|
|
|
|
|
|
2016-09-25 12:59:38 +08:00
|
|
|
|
Add(new Drawable[]
|
2016-09-02 19:30:27 +08:00
|
|
|
|
{
|
2016-09-21 12:25:23 +08:00
|
|
|
|
new OsuHitRenderer
|
|
|
|
|
{
|
|
|
|
|
Objects = beatmap.HitObjects,
|
|
|
|
|
Scale = new Vector2(0.5f),
|
|
|
|
|
Anchor = Anchor.TopLeft,
|
|
|
|
|
Origin = Anchor.TopLeft
|
|
|
|
|
},
|
|
|
|
|
new TaikoHitRenderer
|
|
|
|
|
{
|
|
|
|
|
Objects = beatmap.HitObjects,
|
|
|
|
|
Scale = new Vector2(0.5f),
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight
|
|
|
|
|
},
|
|
|
|
|
new CatchHitRenderer
|
|
|
|
|
{
|
|
|
|
|
Objects = beatmap.HitObjects,
|
|
|
|
|
Scale = new Vector2(0.5f),
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft
|
|
|
|
|
},
|
|
|
|
|
new ManiaHitRenderer
|
|
|
|
|
{
|
|
|
|
|
Objects = beatmap.HitObjects,
|
|
|
|
|
Scale = new Vector2(0.5f),
|
|
|
|
|
Anchor = Anchor.BottomRight,
|
|
|
|
|
Origin = Anchor.BottomRight
|
|
|
|
|
}
|
2016-09-25 12:59:38 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2016-09-02 17:06:36 +08:00
|
|
|
|
}
|
|
|
|
|
}
|