From ae100e3137ca626c90dbbac82da2eed4eef1f661 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 25 Sep 2016 13:59:38 +0900 Subject: [PATCH] Move PlayTest to the VisualTests project. --- .../Tests/TestCaseGamefield.cs | 42 +++++++++++++------ .../osu.Desktop.VisualTests.csproj | 1 + osu.Game/osu.Game.csproj | 1 - 3 files changed, 31 insertions(+), 13 deletions(-) rename osu.Game/GameModes/Play/PlayTest.cs => osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs (70%) diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs similarity index 70% rename from osu.Game/GameModes/Play/PlayTest.cs rename to osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 988ddbbd70..ac133163d0 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -1,30 +1,42 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; -using osu.Framework.GameModes; +using OpenTK; +using osu.Framework.GameModes.Testing; +using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.GameModes.Play.Catch; +using osu.Game.GameModes.Play.Mania; using osu.Game.GameModes.Play.Osu; using osu.Game.GameModes.Play.Taiko; -using osu.Framework.Graphics; -using osu.Game.GameModes.Play.Mania; -using OpenTK; +using System.Collections.Generic; +using osu.Framework.Timing; -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 objects = new List(); - int time = 0; + int time = 500; for (int i = 0; i < 100; i++) { objects.Add(new Circle() @@ -41,7 +53,7 @@ namespace osu.Game.GameModes.Play HitObjects = objects }; - Children = new Drawable[] + Add(new Drawable[] { new OsuHitRenderer { @@ -71,7 +83,13 @@ namespace osu.Game.GameModes.Play Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight } - }; + }); + } + + protected override void Update() + { + base.Update(); + localClock.ProcessFrame(); } } } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 4430339937..393559a257 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -147,6 +147,7 @@ + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9d2a741dcd..3f0d806845 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -79,7 +79,6 @@ -