diff --git a/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs b/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs index 6565ca98f9..a431531427 100644 --- a/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs @@ -72,7 +72,7 @@ namespace osu.Desktop.Tests.Visual [Test] public void TestSpeedAdjustmentOrdering() { - var hitObjectContainer = new ScrollingPlayfield.ScrollingHitObjectContainer(Axes.X); + var hitObjectContainer = new ScrollingPlayfield.ScrollingHitObjectContainer(Axes.X); var speedAdjustments = new[] { @@ -129,7 +129,7 @@ namespace osu.Desktop.Tests.Visual Assert.IsTrue(hitObjectContainer.SpeedAdjustments[3].Contains(hitObjects[1])); } - private class TestRulesetContainer : ScrollingRulesetContainer + private class TestRulesetContainer : ScrollingRulesetContainer { private readonly Axes scrollingAxes; @@ -147,12 +147,12 @@ namespace osu.Desktop.Tests.Visual protected override BeatmapConverter CreateBeatmapConverter() => new TestBeatmapConverter(); - protected override Playfield CreatePlayfield() => new TestPlayfield(scrollingAxes); + protected override Playfield CreatePlayfield() => new TestPlayfield(scrollingAxes); - protected override DrawableHitObject GetVisualRepresentation(TestHitObject h) => new DrawableTestHitObject(scrollingAxes, h); + protected override DrawableHitObject GetVisualRepresentation(TestHitObject h) => new DrawableTestHitObject(scrollingAxes, h); } - private class TestScoreProcessor : ScoreProcessor + private class TestScoreProcessor : ScoreProcessor { protected override void OnNewJudgement(Judgement judgement) { @@ -169,7 +169,7 @@ namespace osu.Desktop.Tests.Visual } } - private class DrawableTestHitObject : DrawableScrollingHitObject + private class DrawableTestHitObject : DrawableScrollingHitObject { public DrawableTestHitObject(Axes scrollingAxes, TestHitObject hitObject) : base(hitObject) @@ -185,14 +185,12 @@ namespace osu.Desktop.Tests.Visual }); } - protected TestJudgement CreateJudgement() => new TestJudgement(); - protected override void UpdateState(ArmedState state) { } } - private class TestPlayfield : ScrollingPlayfield + private class TestPlayfield : ScrollingPlayfield { protected override Container Content => content; private readonly Container content; @@ -218,9 +216,5 @@ namespace osu.Desktop.Tests.Visual private class TestHitObject : HitObject { } - - private class TestJudgement : Judgement - { - } } } diff --git a/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs b/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs index 0bfa21a45e..764cf7a1f8 100644 --- a/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs @@ -214,15 +214,13 @@ namespace osu.Desktop.Tests.Visual rulesetContainer.Playfield.Add(new DrawableRimHit(h)); } - private class DrawableTestHit : DrawableHitObject + private class DrawableTestHit : DrawableHitObject { public DrawableTestHit(TaikoHitObject hitObject) : base(hitObject) { } - protected TaikoJudgement CreateJudgement() => new TaikoJudgement(); - protected override void UpdateState(ArmedState state) { } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 0cbece5544..3dd086fb48 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.MathUtils; using osu.Game.Graphics; -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -17,7 +16,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects.Drawable { - public class DrawableFruit : DrawableScrollingHitObject + public class DrawableFruit : DrawableScrollingHitObject { private const float pulp_size = 30; diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 8a9e17de6e..2637a98fe2 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; @@ -9,13 +8,13 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { - internal class CatchScoreProcessor : ScoreProcessor + internal class CatchScoreProcessor : ScoreProcessor { public CatchScoreProcessor() { } - public CatchScoreProcessor(RulesetContainer rulesetContainer) + public CatchScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index cf00f80e5e..83d22454cb 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -5,7 +5,6 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.UI; using OpenTK; -using osu.Game.Rulesets.Catch.Judgements; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Judgements; @@ -13,7 +12,7 @@ using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Catch.UI { - public class CatchPlayfield : ScrollingPlayfield + public class CatchPlayfield : ScrollingPlayfield { protected override Container Content => content; private readonly Container content; @@ -45,7 +44,7 @@ namespace osu.Game.Rulesets.Catch.UI }; } - public override void Add(DrawableHitObject h) + public override void Add(DrawableHitObject h) { base.Add(h); diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index f8f74af6c9..eb7abf9248 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -5,7 +5,6 @@ using osu.Framework.Input; using osu.Game.Beatmaps; using osu.Game.Rulesets.Beatmaps; using osu.Game.Rulesets.Catch.Beatmaps; -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Catch.Scoring; @@ -15,7 +14,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.UI { - public class CatchRulesetContainer : ScrollingRulesetContainer + public class CatchRulesetContainer : ScrollingRulesetContainer { public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -26,11 +25,11 @@ namespace osu.Game.Rulesets.Catch.UI protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); - protected override Playfield CreatePlayfield() => new CatchPlayfield(); + protected override Playfield CreatePlayfield() => new CatchPlayfield(); public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo); - protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) + protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) { if (h is Fruit) return new DrawableFruit(h); diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 9b8234ea13..5b57be1499 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -2,12 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; -using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Objects.Drawables { - public abstract class DrawableManiaHitObject : DrawableScrollingHitObject + public abstract class DrawableManiaHitObject : DrawableScrollingHitObject where TObject : ManiaHitObject { /// diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index c30c20402a..9ea9dc90fa 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Scoring { - internal class ManiaScoreProcessor : ScoreProcessor + internal class ManiaScoreProcessor : ScoreProcessor { /// /// The maximum score achievable. @@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Mania.Scoring { } - public ManiaScoreProcessor(RulesetContainer rulesetContainer) + public ManiaScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index a8f5b4919d..ce4a84dc80 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -14,11 +14,10 @@ using System; using osu.Framework.Input.Bindings; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.Judgements; namespace osu.Game.Rulesets.Mania.UI { - public class Column : ScrollingPlayfield, IHasAccentColour + public class Column : ScrollingPlayfield, IHasAccentColour { private const float key_icon_size = 10; private const float key_icon_corner_radius = 3; @@ -188,7 +187,7 @@ namespace osu.Game.Rulesets.Mania.UI /// Adds a DrawableHitObject to this Playfield. /// /// The DrawableHitObject to add. - public override void Add(DrawableHitObject hitObject) + public override void Add(DrawableHitObject hitObject) { hitObject.AccentColour = AccentColour; HitObjects.Add(hitObject); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index d3dc920fc6..15f65b5545 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -6,7 +6,6 @@ using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; -using osu.Game.Rulesets.Mania.Judgements; using osu.Framework.Graphics.Containers; using System; using osu.Game.Graphics; @@ -21,7 +20,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Rulesets.Mania.UI { - public class ManiaPlayfield : ScrollingPlayfield + public class ManiaPlayfield : ScrollingPlayfield { public const float HIT_TARGET_POSITION = 50; @@ -203,7 +202,7 @@ namespace osu.Game.Rulesets.Mania.UI } } - public override void Add(DrawableHitObject h) => Columns.ElementAt(h.HitObject.Column).Add(h); + public override void Add(DrawableHitObject h) => Columns.ElementAt(h.HitObject.Column).Add(h); public void Add(DrawableBarLine barline) => HitObjects.Add(barline); protected override void Update() diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 5a3da6d074..49e53a07c9 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -15,7 +15,6 @@ using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps; -using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Scoring; @@ -28,7 +27,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.UI { - public class ManiaRulesetContainer : ScrollingRulesetContainer + public class ManiaRulesetContainer : ScrollingRulesetContainer { /// /// The number of columns which the should display, and which @@ -75,7 +74,7 @@ namespace osu.Game.Rulesets.Mania.UI BarLines.ForEach(Playfield.Add); } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(availableColumns) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(availableColumns) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -105,7 +104,7 @@ namespace osu.Game.Rulesets.Mania.UI return new ManiaBeatmapConverter(IsForCurrentRuleset, availableColumns); } - protected override DrawableHitObject GetVisualRepresentation(ManiaHitObject h) + protected override DrawableHitObject GetVisualRepresentation(ManiaHitObject h) { ManiaAction action = Playfield.Columns.ElementAt(h.Column).Action; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 9faecadbf1..d18b3dd65e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -3,13 +3,12 @@ using System.ComponentModel; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Osu.Judgements; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public class DrawableOsuHitObject : DrawableHitObject + public class DrawableOsuHitObject : DrawableHitObject { public const float TIME_PREEMPT = 600; public const float TIME_FADEIN = 400; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index 0cd30e34ac..7755a54e88 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -9,7 +9,7 @@ using osu.Game.Rulesets.Judgements; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public class DrawableOsuJudgement : DrawableJudgement + public class DrawableOsuJudgement : DrawableJudgement { public DrawableOsuJudgement(OsuJudgement judgement) : base(judgement) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index b6922cbf3b..59d4492480 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Osu.Scoring { - internal class OsuScoreProcessor : ScoreProcessor + internal class OsuScoreProcessor : ScoreProcessor { public readonly Bindable Mode = new Bindable(ScoringMode.Exponential); @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Scoring { } - public OsuScoreProcessor(RulesetContainer rulesetContainer) + public OsuScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 6b367b8be2..e9d9e0e3de 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.Osu.UI.Cursor; namespace osu.Game.Rulesets.Osu.UI { - public class OsuPlayfield : Playfield + public class OsuPlayfield : Playfield { private readonly Container approachCircles; private readonly Container judgementLayer; @@ -68,11 +68,11 @@ namespace osu.Game.Rulesets.Osu.UI AddInternal(new GameplayCursor()); } - public override void Add(DrawableHitObject h) + public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; - IDrawableHitObjectWithProxiedApproach c = h as IDrawableHitObjectWithProxiedApproach; + var c = h as IDrawableHitObjectWithProxiedApproach; if (c != null) approachCircles.Add(c.ProxiedLayer.CreateProxy()); diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index 0b87bf7346..edf7e014a3 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -7,7 +7,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Beatmaps; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Beatmaps; -using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Replays; @@ -18,7 +17,7 @@ using osu.Game.Rulesets.Replays; namespace osu.Game.Rulesets.Osu.UI { - public class OsuRulesetContainer : RulesetContainer + public class OsuRulesetContainer : RulesetContainer { public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -31,11 +30,11 @@ namespace osu.Game.Rulesets.Osu.UI protected override BeatmapProcessor CreateBeatmapProcessor() => new OsuBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new OsuPlayfield(); + protected override Playfield CreatePlayfield() => new OsuPlayfield(); public override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo); - protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h) + protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h) { var circle = h as HitCircle; if (circle != null) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs index 9a25de713a..b30b3a1aca 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -5,14 +5,13 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using OpenTK; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { /// /// A line that scrolls alongside hit objects in the playfield and visualises control points. /// - public class DrawableBarLine : DrawableScrollingHitObject + public class DrawableBarLine : DrawableScrollingHitObject { /// /// The width of the line tracker. diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index e3ddefd05d..7976cbbbc1 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -4,15 +4,13 @@ using osu.Framework.Graphics; using osu.Framework.Input.Bindings; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { - public abstract class DrawableTaikoHitObject - : DrawableScrollingHitObject, IKeyBindingHandler - where TaikoHitType : TaikoHitObject + public abstract class DrawableTaikoHitObject : DrawableScrollingHitObject, IKeyBindingHandler + where TaikoHitType : TaikoHitObject { public override Vector2 OriginPosition => new Vector2(DrawHeight / 2); diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index ca3dcc8984..21d790169c 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -13,7 +13,7 @@ using OpenTK; namespace osu.Game.Rulesets.Taiko.Scoring { - internal class TaikoScoreProcessor : ScoreProcessor + internal class TaikoScoreProcessor : ScoreProcessor { /// /// The maximum score achievable. @@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring { } - public TaikoScoreProcessor(RulesetContainer rulesetContainer) + public TaikoScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs index ea9c59c2a5..fb64b667e6 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Allocation; using osu.Game.Graphics; @@ -13,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// Text that is shown as judgement when a hit object is hit or missed. /// - public class DrawableTaikoJudgement : DrawableJudgement + public class DrawableTaikoJudgement : DrawableJudgement { public readonly DrawableHitObject JudgedObject; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 1fce2b3a48..96ca4c10eb 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -19,7 +19,7 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables; namespace osu.Game.Rulesets.Taiko.UI { - public class TaikoPlayfield : ScrollingPlayfield + public class TaikoPlayfield : ScrollingPlayfield { /// /// Default height of a when inside a . @@ -203,7 +203,7 @@ namespace osu.Game.Rulesets.Taiko.UI background.Colour = colours.Gray0; } - public override void Add(DrawableHitObject h) + public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs index 96e5df12cd..ccb6531b00 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Beatmaps; -using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; using osu.Game.Rulesets.Taiko.Scoring; @@ -22,7 +21,7 @@ using osu.Framework.Input; namespace osu.Game.Rulesets.Taiko.UI { - public class TaikoRulesetContainer : ScrollingRulesetContainer + public class TaikoRulesetContainer : ScrollingRulesetContainer { public TaikoRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -95,13 +94,13 @@ namespace osu.Game.Rulesets.Taiko.UI public override PassThroughInputManager CreateInputManager() => new TaikoInputManager(Ruleset.RulesetInfo); - protected override Playfield CreatePlayfield() => new TaikoPlayfield + protected override Playfield CreatePlayfield() => new TaikoPlayfield { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft }; - protected override DrawableHitObject GetVisualRepresentation(TaikoHitObject h) + protected override DrawableHitObject GetVisualRepresentation(TaikoHitObject h) { var centreHit = h as CentreHit; if (centreHit != null) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 795acdc0cf..12edfd802a 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -16,9 +16,7 @@ namespace osu.Game.Rulesets.Judgements /// /// A drawable object which visualises the hit result of a . /// - /// The type of judgement to visualise. - public class DrawableJudgement : Container - where TJudgement : Judgement + public class DrawableJudgement : Container { protected readonly Judgement Judgement; diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 836113b017..90f6a0ad04 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -32,24 +32,12 @@ namespace osu.Game.Rulesets.Objects.Drawables public abstract class DrawableHitObject : DrawableHitObject where TObject : HitObject - { - public new readonly TObject HitObject; - - protected DrawableHitObject(TObject hitObject) - : base(hitObject) - { - HitObject = hitObject; - } - } - - public abstract class DrawableHitObject : DrawableHitObject - where TObject : HitObject - where TJudgement : Judgement { public event Action OnJudgement; - public override bool HandleInput => Interactive; + public new readonly TObject HitObject; + public override bool HandleInput => Interactive; public bool Interactive = true; /// @@ -65,6 +53,7 @@ namespace osu.Game.Rulesets.Objects.Drawables protected DrawableHitObject(TObject hitObject) : base(hitObject) { + HitObject = hitObject; } private ArmedState state; @@ -202,13 +191,13 @@ namespace osu.Game.Rulesets.Objects.Drawables } } - private List> nestedHitObjects; - protected IEnumerable> NestedHitObjects => nestedHitObjects; + private List> nestedHitObjects; + protected IEnumerable> NestedHitObjects => nestedHitObjects; - protected virtual void AddNested(DrawableHitObject h) + protected virtual void AddNested(DrawableHitObject h) { if (nestedHitObjects == null) - nestedHitObjects = new List>(); + nestedHitObjects = new List>(); h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); nestedHitObjects.Add(h); diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs index a7c4dd0333..5ba9c2ff4d 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs @@ -3,19 +3,17 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Objects.Drawables { /// - /// A basic class that overrides and implements . + /// A basic class that overrides and implements . /// This object does not need to have its set to be able to scroll, as this will /// will be set by the scrolling container that contains it. /// - public abstract class DrawableScrollingHitObject : DrawableHitObject, IScrollingHitObject + public abstract class DrawableScrollingHitObject : DrawableHitObject, IScrollingHitObject where TObject : HitObject - where TJudgement : Judgement { public BindableDouble LifetimeOffset { get; } = new BindableDouble(); @@ -57,7 +55,7 @@ namespace osu.Game.Rulesets.Objects.Drawables set { lifetimeEnd = value; } } - protected override void AddNested(DrawableHitObject h) + protected override void AddNested(DrawableHitObject h) { var scrollingHitObject = h as IScrollingHitObject; scrollingHitObject?.LifetimeOffset.BindTo(LifetimeOffset); diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index aea7e40df4..2ca733d82a 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -135,9 +135,8 @@ namespace osu.Game.Rulesets.Scoring } } - public abstract class ScoreProcessor : ScoreProcessor + public abstract class ScoreProcessor : ScoreProcessor where TObject : HitObject - where TJudgement : Judgement { /// /// All judgements held by this ScoreProcessor. @@ -150,7 +149,7 @@ namespace osu.Game.Rulesets.Scoring { } - protected ScoreProcessor(RulesetContainer rulesetContainer) + protected ScoreProcessor(RulesetContainer rulesetContainer) { Judgements.Capacity = rulesetContainer.Beatmap.HitObjects.Count; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index ba526e2178..ce800b76b1 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -14,9 +14,8 @@ using System.Linq; namespace osu.Game.Rulesets.UI { - public abstract class Playfield : Container + public abstract class Playfield : Container where TObject : HitObject - where TJudgement : Judgement { /// /// The HitObjects contained in this Playfield. @@ -70,7 +69,7 @@ namespace osu.Game.Rulesets.UI public override Axes RelativeSizeAxes { get { return Axes.Both; } - set { throw new InvalidOperationException($@"{nameof(Playfield)}'s {nameof(RelativeSizeAxes)} should never be changed from {Axes.Both}"); } + set { throw new InvalidOperationException($@"{nameof(Playfield)}'s {nameof(RelativeSizeAxes)} should never be changed from {Axes.Both}"); } } /// @@ -82,18 +81,19 @@ namespace osu.Game.Rulesets.UI /// Adds a DrawableHitObject to this Playfield. /// /// The DrawableHitObject to add. - public virtual void Add(DrawableHitObject h) => HitObjects.Add(h); + public virtual void Add(DrawableHitObject h) => HitObjects.Add(h); /// /// Remove a DrawableHitObject from this Playfield. /// /// The DrawableHitObject to remove. - public virtual void Remove(DrawableHitObject h) => HitObjects.Remove(h); + public virtual void Remove(DrawableHitObject h) => HitObjects.Remove(h); /// - /// Triggered when an object's Judgement is updated. + /// Triggered when a new occurs on a . /// - /// The object that Judgement has been updated for. + /// The object that occured for. + /// The that occurred. public virtual void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { } public class HitObjectContainer : CompositeDrawable diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index d87e47794f..9503ac1e0b 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.UI /// /// Base RulesetContainer. Doesn't hold objects. /// - /// Should not be derived - derive instead. + /// Should not be derived - derive instead. /// /// public abstract class RulesetContainer : Container @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.UI public event Action OnAllJudged; /// - /// Whether to apply adjustments to the child based on our own size. + /// Whether to apply adjustments to the child based on our own size. /// public bool AspectAdjust = true; @@ -119,13 +119,15 @@ namespace osu.Game.Rulesets.UI /// RulesetContainer that applies conversion to Beatmaps. Does not contain a Playfield /// and does not load drawable hit objects. /// - /// Should not be derived - derive instead. + /// Should not be derived - derive instead. /// /// /// The type of HitObject contained by this RulesetContainer. public abstract class RulesetContainer : RulesetContainer where TObject : HitObject { + public event Action OnJudgement; + /// /// The Beatmap /// @@ -151,6 +153,20 @@ namespace osu.Game.Rulesets.UI /// protected readonly bool IsForCurrentRuleset; + public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor; + + protected override bool AllObjectsJudged => drawableObjects.All(h => h.AllJudged); + + /// + /// The playfield. + /// + public Playfield Playfield { get; private set; } + + protected override Container Content => content; + private Container content; + + private readonly List> drawableObjects = new List>(); + /// /// Whether to assume the beatmap passed into this is for the current ruleset. /// Creates a hit renderer for a beatmap. @@ -158,7 +174,7 @@ namespace osu.Game.Rulesets.UI /// The ruleset being repesented. /// The beatmap to create the hit renderer for. /// Whether to assume the beatmap is for the current ruleset. - internal RulesetContainer(Ruleset ruleset, WorkingBeatmap workingBeatmap, bool isForCurrentRuleset) + protected RulesetContainer(Ruleset ruleset, WorkingBeatmap workingBeatmap, bool isForCurrentRuleset) : base(ruleset) { Debug.Assert(workingBeatmap != null, "RulesetContainer initialized with a null beatmap."); @@ -194,74 +210,6 @@ namespace osu.Game.Rulesets.UI applyMods(Mods); } - /// - /// Applies the active mods to this RulesetContainer. - /// - /// - private void applyMods(IEnumerable mods) - { - if (mods == null) - return; - - foreach (var mod in mods.OfType>()) - mod.ApplyToRulesetContainer(this); - } - - /// - /// Creates a processor to perform post-processing operations - /// on HitObjects in converted Beatmaps. - /// - /// The Beatmap processor. - protected virtual BeatmapProcessor CreateBeatmapProcessor() => new BeatmapProcessor(); - - /// - /// Creates a converter to convert Beatmap to a specific mode. - /// - /// The Beatmap converter. - protected abstract BeatmapConverter CreateBeatmapConverter(); - } - - /// - /// A derivable RulesetContainer that manages the Playfield and HitObjects. - /// - /// The type of HitObject contained by this RulesetContainer. - /// The type of Judgement of DrawableHitObjects contained by this RulesetContainer. - public abstract class RulesetContainer : RulesetContainer - where TObject : HitObject - where TJudgement : Judgement - { - public event Action OnJudgement; - - public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor; - - /// - /// All the converted hit objects contained by this hit renderer. - /// - public new IEnumerable Objects => Beatmap.HitObjects; - - protected override bool AllObjectsJudged => drawableObjects.All(h => h.AllJudged); - - /// - /// The playfield. - /// - public Playfield Playfield { get; private set; } - - protected override Container Content => content; - private Container content; - - private readonly List> drawableObjects = new List>(); - - /// - /// Creates a hit renderer for a beatmap. - /// - /// The ruleset being repesented. - /// The beatmap to create the hit renderer for. - /// Whether to assume the beatmap is for the current ruleset. - protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) - : base(ruleset, beatmap, isForCurrentRuleset) - { - } - [BackgroundDependencyLoader] private void load() { @@ -276,6 +224,19 @@ namespace osu.Game.Rulesets.UI loadObjects(); } + /// + /// Applies the active mods to this RulesetContainer. + /// + /// + private void applyMods(IEnumerable mods) + { + if (mods == null) + return; + + foreach (var mod in mods.OfType>()) + mod.ApplyToRulesetContainer(this); + } + public override void SetReplay(Replay replay) { base.SetReplay(replay); @@ -320,23 +281,36 @@ namespace osu.Game.Rulesets.UI } /// - /// In some cases we want to apply changes to the relative size of our contained based on custom conditions. + /// Creates a processor to perform post-processing operations + /// on HitObjects in converted Beatmaps. + /// + /// The Beatmap processor. + protected virtual BeatmapProcessor CreateBeatmapProcessor() => new BeatmapProcessor(); + + /// + /// In some cases we want to apply changes to the relative size of our contained based on custom conditions. /// /// protected virtual Vector2 GetPlayfieldAspectAdjust() => new Vector2(0.75f); //a sane default + /// + /// Creates a converter to convert Beatmap to a specific mode. + /// + /// The Beatmap converter. + protected abstract BeatmapConverter CreateBeatmapConverter(); + /// /// Creates a DrawableHitObject from a HitObject. /// /// The HitObject to make drawable. /// The DrawableHitObject. - protected abstract DrawableHitObject GetVisualRepresentation(TObject h); + protected abstract DrawableHitObject GetVisualRepresentation(TObject h); /// /// Creates a Playfield. /// /// The Playfield. - protected abstract Playfield CreatePlayfield(); + protected abstract Playfield CreatePlayfield(); } /// @@ -344,11 +318,9 @@ namespace osu.Game.Rulesets.UI /// /// The type of Playfield contained by this RulesetContainer. /// The type of HitObject contained by this RulesetContainer. - /// The type of Judgement of DrawableHitObjects contained by this RulesetContainer. - public abstract class RulesetContainer : RulesetContainer + public abstract class RulesetContainer : RulesetContainer where TObject : HitObject - where TJudgement : Judgement - where TPlayfield : Playfield + where TPlayfield : Playfield { /// /// The playfield. diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 1d13e2abb1..2162d650db 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; using osu.Framework.MathUtils; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; @@ -19,11 +18,10 @@ using osu.Game.Rulesets.Timing; namespace osu.Game.Rulesets.UI { /// - /// A type of specialized towards scrolling s. + /// A type of specialized towards scrolling s. /// - public class ScrollingPlayfield : Playfield + public class ScrollingPlayfield : Playfield where TObject : HitObject - where TJudgement : Judgement { /// /// The default span of time visible by the length of the scrolling axes. @@ -65,7 +63,7 @@ namespace osu.Game.Rulesets.UI public new readonly ScrollingHitObjectContainer HitObjects; /// - /// Creates a new . + /// Creates a new . /// /// The axes on which s in this container should scroll. /// Whether we want our internal coordinate system to be scaled to a specified width @@ -77,21 +75,21 @@ namespace osu.Game.Rulesets.UI HitObjects.Reversed.BindTo(Reversed); } - private List> nestedPlayfields; + private List> nestedPlayfields; /// - /// All the s nested inside this playfield. + /// All the s nested inside this playfield. /// - public IEnumerable> NestedPlayfields => nestedPlayfields; + public IEnumerable> NestedPlayfields => nestedPlayfields; /// - /// Adds a to this playfield. The nested + /// Adds a to this playfield. The nested /// will be given all of the same speed adjustments as this playfield. /// - /// The to add. - protected void AddNested(ScrollingPlayfield otherPlayfield) + /// The to add. + protected void AddNested(ScrollingPlayfield otherPlayfield) { if (nestedPlayfields == null) - nestedPlayfields = new List>(); + nestedPlayfields = new List>(); nestedPlayfields.Add(otherPlayfield); } @@ -119,7 +117,7 @@ namespace osu.Game.Rulesets.UI this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing)); } - private class TransformVisibleTimeRange : Transform> + private class TransformVisibleTimeRange : Transform> { private double valueAt(double time) { @@ -131,8 +129,8 @@ namespace osu.Game.Rulesets.UI public override string TargetMember => "VisibleTimeRange.Value"; - protected override void Apply(ScrollingPlayfield d, double time) => d.VisibleTimeRange.Value = valueAt(time); - protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value; + protected override void Apply(ScrollingPlayfield d, double time) => d.VisibleTimeRange.Value = valueAt(time); + protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value; } /// diff --git a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs index ff156f788c..c199c90f4a 100644 --- a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs @@ -9,7 +9,6 @@ using osu.Framework.Lists; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.IO.Serialization; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; @@ -17,17 +16,16 @@ using osu.Game.Rulesets.Timing; namespace osu.Game.Rulesets.UI { /// - /// A type of that supports a . - /// s inside this will scroll within the playfield. + /// A type of that supports a . + /// s inside this will scroll within the playfield. /// - public abstract class ScrollingRulesetContainer : RulesetContainer + public abstract class ScrollingRulesetContainer : RulesetContainer where TObject : HitObject - where TJudgement : Judgement - where TPlayfield : ScrollingPlayfield + where TPlayfield : ScrollingPlayfield { /// /// Provides the default s that adjust the scrolling rate of s - /// inside this . + /// inside this . /// /// protected readonly SortedList DefaultControlPoints = new SortedList(Comparer.Default); @@ -88,7 +86,7 @@ namespace osu.Game.Rulesets.UI DefaultControlPoints.ForEach(c => applySpeedAdjustment(c, Playfield)); } - private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield) + private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield) { playfield.HitObjects.AddSpeedAdjustment(CreateSpeedAdjustmentContainer(controlPoint)); playfield.NestedPlayfields.ForEach(p => applySpeedAdjustment(controlPoint, p));