From 95bfe44ae1f08496252e5e8daec48d46489e7fa7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 26 Dec 2019 01:01:03 +0900 Subject: [PATCH 1/4] Update templates with latest ruleset changes --- .../osu.Game.Rulesets.EmptyFreeform.Tests.csproj | 2 +- .../Beatmaps/EmptyFreeformBeatmapConverter.cs | 14 +++++--------- .../EmptyFreeformRuleset.cs | 2 +- .../osu.Game.Rulesets.EmptyFreeform.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.Tests.csproj | 14 +++++++------- .../Beatmaps/PippidonBeatmapConverter.cs | 8 ++++---- .../osu.Game.Rulesets.Pippidon/PippidonRuleset.cs | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- .../osu.Game.Rulesets.EmptyScrolling.Tests.csproj | 2 +- .../Beatmaps/EmptyScrollingBeatmapConverter.cs | 13 +++++-------- .../EmptyScrollingRuleset.cs | 2 +- .../osu.Game.Rulesets.EmptyScrolling.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.Tests.csproj | 2 +- .../Beatmaps/PippidonBeatmapConverter.cs | 9 ++++----- .../osu.Game.Rulesets.Pippidon/PippidonRuleset.cs | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- 16 files changed, 36 insertions(+), 44 deletions(-) diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj index 270664a..130e990 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform.Tests/osu.Game.Rulesets.EmptyFreeform.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs index 193e3a5..92a1299 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.EmptyFreeform.Objects; @@ -13,15 +12,12 @@ namespace osu.Game.Rulesets.EmptyFreeform.Beatmaps { public class EmptyFreeformBeatmapConverter : BeatmapConverter { - protected override IEnumerable ValidConversionTypes { get; } = new[] - { - // todo: Populate with conversion types that should be supported other than position (ie. typeof(IHasCurve)) - // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types - typeof(IHasPosition) - }; + // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) + // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types + public override bool CanConvert() => true; - public EmptyFreeformBeatmapConverter(IBeatmap beatmap) - : base(beatmap) + public EmptyFreeformBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) + : base(beatmap, ruleset) { } diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs index 9954c37..9ef0d57 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs @@ -32,7 +32,7 @@ public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IRea public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new EmptyFreeformScoreProcessor(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => - new EmptyFreeformBeatmapConverter(beatmap); + new EmptyFreeformBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new EmptyFreeformDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj index 9e9b65e..7a509ed 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj b/templates/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj index 98d2b93..7663280 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj @@ -3,20 +3,20 @@ osu.Game.Rulesets.Pippidon.Tests.VisualTestRunner - + false - - - - - + + + + + - + WinExe diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs index 617f6af..b8edf62 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs @@ -1,8 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; +using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -13,10 +13,10 @@ namespace osu.Game.Rulesets.Pippidon.Beatmaps { public class PippidonBeatmapConverter : BeatmapConverter { - protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; + public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasPosition); - public PippidonBeatmapConverter(IBeatmap beatmap) - : base(beatmap) + public PippidonBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) + : base(beatmap, ruleset) { } diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs index 9992133..a99a452 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs @@ -28,7 +28,7 @@ public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IRea public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new PippidonScoreProcessor(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => - new PippidonBeatmapConverter(beatmap); + new PippidonBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new PippidonDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index bec8159..bcccc8f 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -10,6 +10,6 @@ - + \ No newline at end of file diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj index 0977c65..44f6e72 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling.Tests/osu.Game.Rulesets.EmptyScrolling.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs index b4d6b64..8a66cd0 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; @@ -11,14 +10,12 @@ namespace osu.Game.Rulesets.EmptyScrolling.Beatmaps { public class EmptyScrollingBeatmapConverter : BeatmapConverter { - protected override IEnumerable ValidConversionTypes { get; } = new Type[] - { - // todo: Populate with conversion types that should be supported (ie. typeof(IHasXPosition)) - // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types - }; + // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) + // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types + public override bool CanConvert() => true; - public EmptyScrollingBeatmapConverter(IBeatmap beatmap) - : base(beatmap) + public EmptyScrollingBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) + : base(beatmap, ruleset) { } diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs index baab330..ccede8c 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs @@ -26,7 +26,7 @@ public class EmptyScrollingRuleset : Ruleset public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new EmptyScrollingScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new EmptyScrollingBeatmapConverter(beatmap); + public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new EmptyScrollingBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new EmptyScrollingDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj index c3fed25..1cbd611 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj index 03646ee..5cdbe78 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon.Tests/osu.Game.Rulesets.Pippidon.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs index 14ccc09..8f23873 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; @@ -18,15 +17,15 @@ public class PippidonBeatmapConverter : BeatmapConverter private readonly float minPosition; private readonly float maxPosition; - protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition), typeof(IHasYPosition) }; - - public PippidonBeatmapConverter(IBeatmap beatmap) - : base(beatmap) + public PippidonBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) + : base(beatmap, ruleset) { minPosition = beatmap.HitObjects.Min(getUsablePosition); maxPosition = beatmap.HitObjects.Max(getUsablePosition); } + public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasXPosition && h is IHasYPosition); + protected override IEnumerable ConvertHitObject(HitObject original, IBeatmap beatmap) { yield return new PippidonHitObject diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs index d8f3731..12db257 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs @@ -26,7 +26,7 @@ public class PippidonRuleset : Ruleset public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new PippidonScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new PippidonBeatmapConverter(beatmap); + public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new PippidonBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new PippidonDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index bec8159..bcccc8f 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -10,6 +10,6 @@ - + \ No newline at end of file From 4242174bd7235fcac1132e83b0e0b08609c844c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 31 Jan 2020 16:50:15 +0900 Subject: [PATCH 2/4] Bring game up-to-date again --- .../osu.Game.Rulesets.EmptyFreeform.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- .../osu.Game.Rulesets.EmptyScrolling.csproj | 2 +- .../osu.Game.Rulesets.Pippidon.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj index 7a509ed..241b4ba 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/osu.Game.Rulesets.EmptyFreeform.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index bcccc8f..5c115d1 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -10,6 +10,6 @@ - + \ No newline at end of file diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj index 1cbd611..5ca15fd 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/osu.Game.Rulesets.EmptyScrolling.csproj @@ -10,7 +10,7 @@ - + diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj index bcccc8f..5c115d1 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/osu.Game.Rulesets.Pippidon.csproj @@ -10,6 +10,6 @@ - + \ No newline at end of file From 5fd70ccbf2c3be797a7c7affcb95ebb755a9d92f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 31 Jan 2020 16:51:22 +0900 Subject: [PATCH 3/4] Move methods below ctor --- .../Beatmaps/EmptyFreeformBeatmapConverter.cs | 8 ++++---- .../Beatmaps/PippidonBeatmapConverter.cs | 4 ++-- .../Beatmaps/EmptyScrollingBeatmapConverter.cs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs index 92a1299..a11ff4c 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Beatmaps/EmptyFreeformBeatmapConverter.cs @@ -12,15 +12,15 @@ namespace osu.Game.Rulesets.EmptyFreeform.Beatmaps { public class EmptyFreeformBeatmapConverter : BeatmapConverter { - // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) - // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types - public override bool CanConvert() => true; - public EmptyFreeformBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) : base(beatmap, ruleset) { } + // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) + // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types + public override bool CanConvert() => true; + protected override IEnumerable ConvertHitObject(HitObject original, IBeatmap beatmap) { yield return new EmptyFreeformHitObject diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs index b8edf62..46b6e01 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonBeatmapConverter.cs @@ -13,13 +13,13 @@ namespace osu.Game.Rulesets.Pippidon.Beatmaps { public class PippidonBeatmapConverter : BeatmapConverter { - public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasPosition); - public PippidonBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) : base(beatmap, ruleset) { } + public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasPosition); + protected override IEnumerable ConvertHitObject(HitObject original, IBeatmap beatmap) { yield return new PippidonHitObject diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs index 8a66cd0..62a1b27 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Beatmaps/EmptyScrollingBeatmapConverter.cs @@ -10,15 +10,15 @@ namespace osu.Game.Rulesets.EmptyScrolling.Beatmaps { public class EmptyScrollingBeatmapConverter : BeatmapConverter { - // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) - // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types - public override bool CanConvert() => true; - public EmptyScrollingBeatmapConverter(IBeatmap beatmap, Ruleset ruleset) : base(beatmap, ruleset) { } + // todo: Check for conversion types that should be supported (ie. Beatmap.HitObjects.Any(h => h is IHasXPosition)) + // https://github.com/ppy/osu/tree/master/osu.Game/Rulesets/Objects/Types + public override bool CanConvert() => true; + protected override IEnumerable ConvertHitObject(HitObject original, IBeatmap beatmap) { yield return new EmptyScrollingHitObject From f1452c94ec1b0b9c59ff5db23389b8378f67297f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 31 Jan 2020 17:04:53 +0900 Subject: [PATCH 4/4] Bring score processors and namespaces in line with latest changes --- .../EmptyFreeformRuleset.cs | 4 ---- .../EmptyFreeformFramedReplayInputHandler.cs | 2 +- .../Scoring/EmptyFreeformScoreProcessor.cs | 24 ------------------- .../PippidonRuleset.cs | 4 ---- .../PippidonFramedReplayInputHandler.cs | 2 +- .../Scoring/PippidonScoreProcessor.cs | 5 ---- .../EmptyScrollingRuleset.cs | 4 ---- .../Scoring/EmptyScrollingScoreProcessor.cs | 24 ------------------- .../PippidonRuleset.cs | 4 ---- .../Scoring/PippidonScoreProcessor.cs | 24 ------------------- .../UI/PippidonCharacter.cs | 6 +++-- 11 files changed, 6 insertions(+), 97 deletions(-) delete mode 100644 templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Scoring/EmptyFreeformScoreProcessor.cs delete mode 100644 templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Scoring/EmptyScrollingScoreProcessor.cs delete mode 100644 templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs index 9ef0d57..96675e3 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/EmptyFreeformRuleset.cs @@ -12,9 +12,7 @@ using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.EmptyFreeform.Beatmaps; using osu.Game.Rulesets.EmptyFreeform.Mods; -using osu.Game.Rulesets.EmptyFreeform.Scoring; using osu.Game.Rulesets.EmptyFreeform.UI; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using osuTK; @@ -29,8 +27,6 @@ public class EmptyFreeformRuleset : Ruleset public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => new DrawableEmptyFreeformRuleset(this, beatmap, mods); - public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new EmptyFreeformScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new EmptyFreeformBeatmapConverter(beatmap, this); diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Replays/EmptyFreeformFramedReplayInputHandler.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Replays/EmptyFreeformFramedReplayInputHandler.cs index 450ca78..d1ea742 100644 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Replays/EmptyFreeformFramedReplayInputHandler.cs +++ b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Replays/EmptyFreeformFramedReplayInputHandler.cs @@ -5,7 +5,7 @@ using System.Diagnostics; using System.Linq; using osu.Framework.Input.StateChanges; -using osu.Framework.MathUtils; +using osu.Framework.Utils; using osu.Game.Replays; using osu.Game.Rulesets.Replays; using osuTK; diff --git a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Scoring/EmptyFreeformScoreProcessor.cs b/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Scoring/EmptyFreeformScoreProcessor.cs deleted file mode 100644 index 24e3c56..0000000 --- a/templates/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Scoring/EmptyFreeformScoreProcessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.EmptyFreeform.Scoring -{ - public class EmptyFreeformScoreProcessor : ScoreProcessor - { - public EmptyFreeformScoreProcessor(IBeatmap beatmap) - : base(beatmap) - { - } - - protected override void Reset(bool storeResults) - { - base.Reset(storeResults); - - Health.Value = 1; - Accuracy.Value = 1; - } - } -} diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs index a99a452..89fed79 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs @@ -11,9 +11,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Pippidon.Beatmaps; using osu.Game.Rulesets.Pippidon.Mods; -using osu.Game.Rulesets.Pippidon.Scoring; using osu.Game.Rulesets.Pippidon.UI; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Pippidon @@ -25,8 +23,6 @@ public class PippidonRuleset : Ruleset public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => new DrawablePippidonRuleset(this, beatmap, mods); - public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new PippidonScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new PippidonBeatmapConverter(beatmap, this); diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Replays/PippidonFramedReplayInputHandler.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Replays/PippidonFramedReplayInputHandler.cs index 3907927..286b295 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Replays/PippidonFramedReplayInputHandler.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Replays/PippidonFramedReplayInputHandler.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using osu.Framework.Input.StateChanges; -using osu.Framework.MathUtils; +using osu.Framework.Utils; using osu.Game.Replays; using osu.Game.Rulesets.Replays; using osuTK; diff --git a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs index f67f2b0..1c4fe69 100644 --- a/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs +++ b/templates/ruleset-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs @@ -1,16 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Pippidon.Scoring { public class PippidonScoreProcessor : ScoreProcessor { - public PippidonScoreProcessor(IBeatmap beatmap) - : base(beatmap) - { - } } } diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs index ccede8c..c1d4de5 100644 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs +++ b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/EmptyScrollingRuleset.cs @@ -11,9 +11,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.EmptyScrolling.Beatmaps; using osu.Game.Rulesets.EmptyScrolling.Mods; -using osu.Game.Rulesets.EmptyScrolling.Scoring; using osu.Game.Rulesets.EmptyScrolling.UI; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.EmptyScrolling @@ -24,8 +22,6 @@ public class EmptyScrollingRuleset : Ruleset public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => new DrawableEmptyScrollingRuleset(this, beatmap, mods); - public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new EmptyScrollingScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new EmptyScrollingBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new EmptyScrollingDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Scoring/EmptyScrollingScoreProcessor.cs b/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Scoring/EmptyScrollingScoreProcessor.cs deleted file mode 100644 index 2e0d593..0000000 --- a/templates/ruleset-scrolling-empty/osu.Game.Rulesets.EmptyScrolling/Scoring/EmptyScrollingScoreProcessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.EmptyScrolling.Scoring -{ - public class EmptyScrollingScoreProcessor : ScoreProcessor - { - public EmptyScrollingScoreProcessor(IBeatmap beatmap) - : base(beatmap) - { - } - - protected override void Reset(bool storeResults) - { - base.Reset(storeResults); - - Health.Value = 1; - Accuracy.Value = 1; - } - } -} diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs index 12db257..ede00f1 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/PippidonRuleset.cs @@ -11,9 +11,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Pippidon.Beatmaps; using osu.Game.Rulesets.Pippidon.Mods; -using osu.Game.Rulesets.Pippidon.Scoring; using osu.Game.Rulesets.Pippidon.UI; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Pippidon @@ -24,8 +22,6 @@ public class PippidonRuleset : Ruleset public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => new DrawablePippidonRuleset(this, beatmap, mods); - public override ScoreProcessor CreateScoreProcessor(IBeatmap beatmap) => new PippidonScoreProcessor(beatmap); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new PippidonBeatmapConverter(beatmap, this); public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new PippidonDifficultyCalculator(this, beatmap); diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs deleted file mode 100644 index 9fb9fb5..0000000 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/Scoring/PippidonScoreProcessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.Pippidon.Scoring -{ - public class PippidonScoreProcessor : ScoreProcessor - { - public PippidonScoreProcessor(IBeatmap beatmap) - : base(beatmap) - { - } - - protected override void Reset(bool storeResults) - { - base.Reset(storeResults); - - Health.Value = 1; - Accuracy.Value = 1; - } - } -} diff --git a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/UI/PippidonCharacter.cs b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/UI/PippidonCharacter.cs index 1fed801..b27a98f 100644 --- a/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/UI/PippidonCharacter.cs +++ b/templates/ruleset-scrolling-example/osu.Game.Rulesets.Pippidon/UI/PippidonCharacter.cs @@ -78,8 +78,10 @@ public bool OnPressed(PippidonAction action) } } - private void changeLane(int change) => LanePosition.Value = (LanePosition.Value + change + PippidonPlayfield.LANE_COUNT) % PippidonPlayfield.LANE_COUNT; + public void OnReleased(PippidonAction action) + { + } - public bool OnReleased(PippidonAction action) => false; + private void changeLane(int change) => LanePosition.Value = (LanePosition.Value + change + PippidonPlayfield.LANE_COUNT) % PippidonPlayfield.LANE_COUNT; } }