From d30706f640c1bc957c02f19056717b00e55cd106 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 1 Jun 2017 15:13:52 +0900 Subject: [PATCH] Move drawable timing changes to Timing/Drawables. --- .../Tests/TestCaseManiaPlayfield.cs | 1 + .../Drawables/DrawableGravityTimingChange.cs | 25 +++++++++++++++ .../DrawableScrollingTimingChange.cs | 17 ++++++++++ .../{ => Drawables}/DrawableTimingChange.cs | 32 +------------------ .../Timing/TimingChangeContainer.cs | 1 + osu.Game.Rulesets.Mania/UI/Column.cs | 1 + .../UI/ManiaHitRenderer.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 1 + .../osu.Game.Rulesets.Mania.csproj | 4 ++- 9 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs create mode 100644 osu.Game.Rulesets.Mania/Timing/Drawables/DrawableScrollingTimingChange.cs rename osu.Game.Rulesets.Mania/Timing/{ => Drawables}/DrawableTimingChange.cs (78%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs index 20e94e0dde..ea6548d296 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs @@ -15,6 +15,7 @@ using osu.Framework.Configuration; using OpenTK.Input; using osu.Framework.Timing; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Game.Rulesets.Mania.Timing.Drawables; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs new file mode 100644 index 0000000000..cb7a290cd2 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs @@ -0,0 +1,25 @@ +using osu.Framework.Physics; + +namespace osu.Game.Rulesets.Mania.Timing.Drawables +{ + public class DrawableGravityTimingChange : DrawableTimingChange + { + private const float acceleration = 9.8f; + private const float terminal_velocity = 50f; + + private RigidBodySimulation sim; + + public DrawableGravityTimingChange(TimingChange timingChange) + : base(timingChange) + { + sim = new RigidBodySimulation(Content); + } + + protected override void Update() + { + base.Update(); + + // Todo: Gravity calculations here + } + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableScrollingTimingChange.cs b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableScrollingTimingChange.cs new file mode 100644 index 0000000000..dce644cec2 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableScrollingTimingChange.cs @@ -0,0 +1,17 @@ +namespace osu.Game.Rulesets.Mania.Timing.Drawables +{ + public class DrawableScrollingTimingChange : DrawableTimingChange + { + public DrawableScrollingTimingChange(TimingChange timingChange) + : base(timingChange) + { + } + + protected override void Update() + { + base.Update(); + + Content.Y = (float)(TimingChange.Time - Time.Current); + } + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Timing/DrawableTimingChange.cs b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableTimingChange.cs similarity index 78% rename from osu.Game.Rulesets.Mania/Timing/DrawableTimingChange.cs rename to osu.Game.Rulesets.Mania/Timing/Drawables/DrawableTimingChange.cs index 38b28f16a8..045a3d33cc 100644 --- a/osu.Game.Rulesets.Mania/Timing/DrawableTimingChange.cs +++ b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableTimingChange.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; -namespace osu.Game.Rulesets.Mania.Timing +namespace osu.Game.Rulesets.Mania.Timing.Drawables { public abstract class DrawableTimingChange : Container { @@ -79,34 +79,4 @@ namespace osu.Game.Rulesets.Mania.Timing } } } - - public class DrawableScrollingTimingChange : DrawableTimingChange - { - public DrawableScrollingTimingChange(TimingChange timingChange) - : base(timingChange) - { - } - - protected override void Update() - { - base.Update(); - - Content.Y = (float)(TimingChange.Time - Time.Current); - } - } - - public class DrawableGravityTimingChange : DrawableTimingChange - { - public DrawableGravityTimingChange(TimingChange timingChange) - : base(timingChange) - { - } - - protected override void Update() - { - base.Update(); - - // Todo: Gravity calculations here - } - } } \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Timing/TimingChangeContainer.cs b/osu.Game.Rulesets.Mania/Timing/TimingChangeContainer.cs index 8acbe6d24c..d01819b291 100644 --- a/osu.Game.Rulesets.Mania/Timing/TimingChangeContainer.cs +++ b/osu.Game.Rulesets.Mania/Timing/TimingChangeContainer.cs @@ -10,6 +10,7 @@ using OpenTK; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Mania.Timing.Drawables; namespace osu.Game.Rulesets.Mania.Timing { diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index edb396a1e6..75e1c4e8ec 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -18,6 +18,7 @@ using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Judgements; using System; using osu.Framework.Configuration; +using osu.Game.Rulesets.Mania.Timing.Drawables; namespace osu.Game.Rulesets.Mania.UI { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs index 9c698225ec..0a2b929446 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs @@ -21,7 +21,7 @@ using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Scoring; using osu.Game.Rulesets.Mania.Timing; -using osu.Game.Rulesets.Mania.Timing.Drawable; +using osu.Game.Rulesets.Mania.Timing.Drawables; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index a50673d117..792227ae90 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -22,6 +22,7 @@ using osu.Framework.Input; using osu.Framework.Graphics.Transforms; using osu.Framework.MathUtils; using osu.Game.Rulesets.Mania.Objects.Drawables; +using osu.Game.Rulesets.Mania.Timing.Drawables; namespace osu.Game.Rulesets.Mania.UI { diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index c437847a2b..5b8cf0457b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -83,7 +83,9 @@ - + + +