Move PlayTest to the VisualTests project.

This commit is contained in:
Dean Herbert 2016-09-25 13:59:38 +09:00
parent 58ed5c00e4
commit ae100e3137
3 changed files with 31 additions and 13 deletions

View File

@ -1,30 +1,42 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using OpenTK;
using osu.Framework.GameModes; using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects;
using osu.Game.Beatmaps.Objects.Osu; using osu.Game.Beatmaps.Objects.Osu;
using osu.Game.GameModes.Play.Catch; using osu.Game.GameModes.Play.Catch;
using osu.Game.GameModes.Play.Mania;
using osu.Game.GameModes.Play.Osu; using osu.Game.GameModes.Play.Osu;
using osu.Game.GameModes.Play.Taiko; using osu.Game.GameModes.Play.Taiko;
using osu.Framework.Graphics; using System.Collections.Generic;
using osu.Game.GameModes.Play.Mania; using osu.Framework.Timing;
using OpenTK;
namespace osu.Game.GameModes.Play namespace osu.Desktop.Tests
{ {
public class PlayTest : GameMode class TestCaseGamefield : TestCase
{ {
public override void Load() public override string Name => @"Gamefield";
public override string Description => @"Showing hitobjects and what not.";
FramedOffsetClock localClock;
protected override IFrameBasedClock Clock => localClock;
public override void Reset()
{ {
base.Load(); base.Reset();
///create a new clock offset to 0.
localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime };
List<BaseHit> objects = new List<BaseHit>(); List<BaseHit> objects = new List<BaseHit>();
int time = 0; int time = 500;
for (int i = 0; i < 100; i++) for (int i = 0; i < 100; i++)
{ {
objects.Add(new Circle() objects.Add(new Circle()
@ -41,7 +53,7 @@ namespace osu.Game.GameModes.Play
HitObjects = objects HitObjects = objects
}; };
Children = new Drawable[] Add(new Drawable[]
{ {
new OsuHitRenderer new OsuHitRenderer
{ {
@ -71,7 +83,13 @@ namespace osu.Game.GameModes.Play
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight Origin = Anchor.BottomRight
} }
}; });
}
protected override void Update()
{
base.Update();
localClock.ProcessFrame();
} }
} }
} }

View File

@ -147,6 +147,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Tests\TestCaseGamefield.cs" />
<Compile Include="Tests\TestCaseTextAwesome.cs" /> <Compile Include="Tests\TestCaseTextAwesome.cs" />
<Compile Include="VisualTestGame.cs" /> <Compile Include="VisualTestGame.cs" />
</ItemGroup> </ItemGroup>

View File

@ -79,7 +79,6 @@
<Compile Include="GameModes\Play\Osu\OsuHitRenderer.cs" /> <Compile Include="GameModes\Play\Osu\OsuHitRenderer.cs" />
<Compile Include="GameModes\Play\Osu\OsuPlayfield.cs" /> <Compile Include="GameModes\Play\Osu\OsuPlayfield.cs" />
<Compile Include="GameModes\Play\Playfield.cs" /> <Compile Include="GameModes\Play\Playfield.cs" />
<Compile Include="GameModes\Play\PlayTest.cs" />
<Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" /> <Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" />
<Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" /> <Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" />
<Compile Include="Graphics\Containers\OsuComponent.cs" /> <Compile Include="Graphics\Containers\OsuComponent.cs" />