From 723e27353c0a25792f7361729ccb33aef8c48b9d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Aug 2017 13:28:29 +0900 Subject: [PATCH] HitRenderer -> RulesetContainer --- osu.Desktop.Tests/Visual/TestCaseGamefield.cs | 8 +-- .../Visual/TestCaseScrollingPlayfield.cs | 10 ++-- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../Scoring/CatchScoreProcessor.cs | 4 +- ...itRenderer.cs => CatchRulesetContainer.cs} | 4 +- .../osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/IGenerateSpeedAdjustments.cs | 4 +- .../Mods/ManiaModGravity.cs | 10 ++-- .../Scoring/ManiaScoreProcessor.cs | 4 +- ...itRenderer.cs => ManiaRulesetContainer.cs} | 4 +- .../osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../Scoring/OsuScoreProcessor.cs | 4 +- ...uHitRenderer.cs => OsuRulesetContainer.cs} | 4 +- .../osu.Game.Rulesets.Osu.csproj | 2 +- .../Scoring/TaikoScoreProcessor.cs | 4 +- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- ...itRenderer.cs => TaikoRulesetContainer.cs} | 4 +- .../osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableMod.cs | 10 ++-- osu.Game/Rulesets/Mods/ModAutoplay.cs | 4 +- osu.Game/Rulesets/Ruleset.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 8 +-- .../{HitRenderer.cs => RulesetContainer.cs} | 50 +++++++++---------- ...nderer.cs => ScrollingRulesetContainer.cs} | 10 ++-- osu.Game/Screens/Play/HUDOverlay.cs | 6 +-- osu.Game/Screens/Play/Player.cs | 40 +++++++-------- osu.Game/Screens/Play/ReplayPlayer.cs | 2 +- osu.Game/osu.Game.csproj | 4 +- 32 files changed, 110 insertions(+), 110 deletions(-) rename osu.Game.Rulesets.Catch/UI/{CatchHitRenderer.cs => CatchRulesetContainer.cs} (84%) rename osu.Game.Rulesets.Mania/UI/{ManiaHitRenderer.cs => ManiaRulesetContainer.cs} (92%) rename osu.Game.Rulesets.Osu/UI/{OsuHitRenderer.cs => OsuRulesetContainer.cs} (88%) rename osu.Game.Rulesets.Taiko/UI/{TaikoHitRenderer.cs => TaikoRulesetContainer.cs} (93%) rename osu.Game/Rulesets/UI/{HitRenderer.cs => RulesetContainer.cs} (84%) rename osu.Game/Rulesets/UI/{ScrollingHitRenderer.cs => ScrollingRulesetContainer.cs} (87%) diff --git a/osu.Desktop.Tests/Visual/TestCaseGamefield.cs b/osu.Desktop.Tests/Visual/TestCaseGamefield.cs index 98dda56d41..73c61f5669 100644 --- a/osu.Desktop.Tests/Visual/TestCaseGamefield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseGamefield.cs @@ -88,25 +88,25 @@ namespace osu.Desktop.Tests.Visual Clock = new FramedClock(), Children = new Drawable[] { - new OsuHitRenderer(new OsuRuleset(new RulesetInfo()), beatmap, false) + new OsuRulesetContainer(new OsuRuleset(new RulesetInfo()), beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft }, - new TaikoHitRenderer(new TaikoRuleset(new RulesetInfo()),beatmap, false) + new TaikoRulesetContainer(new TaikoRuleset(new RulesetInfo()),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.TopRight, Origin = Anchor.TopRight }, - new CatchHitRenderer(new CatchRuleset(new RulesetInfo()),beatmap, false) + new CatchRulesetContainer(new CatchRuleset(new RulesetInfo()),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, - new ManiaHitRenderer(new ManiaRuleset(new RulesetInfo()),beatmap, false) + new ManiaRulesetContainer(new ManiaRuleset(new RulesetInfo()),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.BottomRight, diff --git a/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs b/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs index aaa2f7d49d..861e79b0b1 100644 --- a/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseScrollingPlayfield.cs @@ -50,15 +50,15 @@ namespace osu.Desktop.Tests.Visual WorkingBeatmap beatmap = new TestWorkingBeatmap(b); - TestHitRenderer hitRenderer; - Add(hitRenderer = new TestHitRenderer(beatmap, true)); + TestRulesetContainer rulesetContainer; + Add(rulesetContainer = new TestRulesetContainer(beatmap, true)); - AddStep("Reverse direction", () => hitRenderer.Playfield.Reversed.Value = !hitRenderer.Playfield.Reversed); + AddStep("Reverse direction", () => rulesetContainer.Playfield.Reversed.Value = !rulesetContainer.Playfield.Reversed); } - private class TestHitRenderer : ScrollingHitRenderer + private class TestRulesetContainer : ScrollingRulesetContainer { - public TestHitRenderer(WorkingBeatmap beatmap, bool isForCurrentRuleset) + public TestRulesetContainer(WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(null, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 66e2fd30bb..8d45ea8fa2 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch { public class CatchRuleset : Ruleset { - public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchHitRenderer(this, beatmap, isForCurrentRuleset); + public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset); public override IEnumerable GetModsFor(ModType type) { diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 1c866320c9..33c1355823 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -14,8 +14,8 @@ namespace osu.Game.Rulesets.Catch.Scoring { } - public CatchScoreProcessor(HitRenderer hitRenderer) - : base(hitRenderer) + public CatchScoreProcessor(RulesetContainer rulesetContainer) + : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs similarity index 84% rename from osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs rename to osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index d08b349459..27cc05c47a 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -15,9 +15,9 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.UI { - public class CatchHitRenderer : ScrollingHitRenderer + public class CatchRulesetContainer : ScrollingRulesetContainer { - public CatchHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index fcffcb8060..8fefdc7b3c 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -60,7 +60,7 @@ - + diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index b61230d347..50ad6960ae 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Mania { public class ManiaRuleset : Ruleset { - public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaHitRenderer(this, beatmap, isForCurrentRuleset); + public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset); public override IEnumerable GetModsFor(ModType type) { diff --git a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs b/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs index f179aa2ff8..954ee3f481 100644 --- a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs +++ b/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs @@ -15,9 +15,9 @@ namespace osu.Game.Rulesets.Mania.Mods /// /// Applies this mod to a hit renderer. /// - /// The hit renderer to apply to. + /// The hit renderer to apply to. /// The per-column list of speed adjustments for hit objects. /// The list of speed adjustments for bar lines. - void ApplyToHitRenderer(ManiaHitRenderer hitRenderer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges); + void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges); } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index 1ba8ac4710..a054e0db56 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Mania.Mods public override FontAwesome Icon => FontAwesome.fa_sort_desc; - public void ApplyToHitRenderer(ManiaHitRenderer hitRenderer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges) + public void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges) { // We have to generate one speed adjustment per hit object for gravity - foreach (ManiaHitObject obj in hitRenderer.Objects) + foreach (ManiaHitObject obj in rulesetContainer.Objects) { - MultiplierControlPoint controlPoint = hitRenderer.CreateControlPointAt(obj.StartTime); + MultiplierControlPoint controlPoint = rulesetContainer.CreateControlPointAt(obj.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now controlPoint.TimingPoint.BeatLength = 1000; @@ -33,9 +33,9 @@ namespace osu.Game.Rulesets.Mania.Mods } // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (DrawableBarLine barLine in hitRenderer.BarLines) + foreach (DrawableBarLine barLine in rulesetContainer.BarLines) { - var controlPoint = hitRenderer.CreateControlPointAt(barLine.HitObject.StartTime); + var controlPoint = rulesetContainer.CreateControlPointAt(barLine.HitObject.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now controlPoint.TimingPoint.BeatLength = 1000; diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index f575342486..63b443319f 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -155,8 +155,8 @@ namespace osu.Game.Rulesets.Mania.Scoring { } - public ManiaScoreProcessor(HitRenderer hitRenderer) - : base(hitRenderer) + public ManiaScoreProcessor(RulesetContainer rulesetContainer) + : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs similarity index 92% rename from osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs rename to osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index ffb3ad4a45..7f6b19f3bd 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -29,7 +29,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.UI { - public class ManiaHitRenderer : ScrollingHitRenderer + public class ManiaRulesetContainer : ScrollingRulesetContainer { /// /// Preferred column count. This will only have an effect during the initialization of the play field. @@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Mania.UI public IEnumerable BarLines; - public ManiaHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { // Generate the bar lines diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 3832f9ace5..fb0b2d907f 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -82,7 +82,7 @@ - + diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index d80beaf0a3..212c634aaf 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Osu { public class OsuRuleset : Ruleset { - public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new OsuHitRenderer(this, beatmap, isForCurrentRuleset); + public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new OsuRulesetContainer(this, beatmap, isForCurrentRuleset); public override IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new[] { diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index 079ee928af..856ca0c98d 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -18,8 +18,8 @@ namespace osu.Game.Rulesets.Osu.Scoring { } - public OsuScoreProcessor(HitRenderer hitRenderer) - : base(hitRenderer) + public OsuScoreProcessor(RulesetContainer rulesetContainer) + : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs similarity index 88% rename from osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs rename to osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index 1356e97907..d029524a32 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -16,9 +16,9 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Osu.UI { - public class OsuHitRenderer : HitRenderer + public class OsuRulesetContainer : RulesetContainer { - public OsuHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 684060c981..b24d5b3a4a 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -80,7 +80,7 @@ - + diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 70df3d8317..647a1381c6 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -113,8 +113,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring { } - public TaikoScoreProcessor(HitRenderer hitRenderer) - : base(hitRenderer) + public TaikoScoreProcessor(RulesetContainer rulesetContainer) + : base(rulesetContainer) { } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 9b2536a7ec..4d4bbb7bc5 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Taiko { public class TaikoRuleset : Ruleset { - public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new TaikoHitRenderer(this, beatmap, isForCurrentRuleset); + public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new TaikoRulesetContainer(this, beatmap, isForCurrentRuleset); public override IEnumerable GetModsFor(ModType type) { diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index dca339f734..119cd64fef 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Taiko.UI public class TaikoPlayfield : Playfield { /// - /// Default height of a when inside a . + /// Default height of a when inside a . /// public const float DEFAULT_HEIGHT = 178; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs similarity index 93% rename from osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs rename to osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs index cb89cfed72..29f563b735 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs @@ -21,9 +21,9 @@ using System.Linq; namespace osu.Game.Rulesets.Taiko.UI { - public class TaikoHitRenderer : HitRenderer + public class TaikoRulesetContainer : RulesetContainer { - public TaikoHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + public TaikoRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index f719f2002b..59c6f4db0a 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -91,7 +91,7 @@ - + diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 7538893cb7..2fb9a568f8 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -62,7 +62,7 @@ namespace osu.Game.Beatmaps public override Mod GetAutoplayMod() => new ModAutoplay(); - public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) + public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) { throw new NotImplementedException(); } diff --git a/osu.Game/Rulesets/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs index 18e1ae4b3d..1957952720 100644 --- a/osu.Game/Rulesets/Mods/IApplicableMod.cs +++ b/osu.Game/Rulesets/Mods/IApplicableMod.cs @@ -7,16 +7,16 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mods { /// - /// An interface for mods that are applied to a HitRenderer. + /// An interface for mods that are applied to a RulesetContainer. /// - /// The type of HitObject the HitRenderer contains. + /// The type of HitObject the RulesetContainer contains. public interface IApplicableMod where TObject : HitObject { /// - /// Applies the mod to a HitRenderer. + /// Applies the mod to a RulesetContainer. /// - /// The HitRenderer to apply the mod to. - void ApplyToHitRenderer(HitRenderer hitRenderer); + /// The RulesetContainer to apply the mod to. + void ApplyToRulesetContainer(RulesetContainer rulesetContainer); } } diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index 1217bf835f..ca120e446e 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -15,9 +15,9 @@ namespace osu.Game.Rulesets.Mods { protected abstract Score CreateReplayScore(Beatmap beatmap); - public void ApplyToHitRenderer(HitRenderer hitRenderer) + public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) { - hitRenderer.SetReplay(CreateReplayScore(hitRenderer.Beatmap)?.Replay); + rulesetContainer.SetReplay(CreateReplayScore(rulesetContainer.Beatmap)?.Replay); } } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 4a492b84fb..ba040403ba 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets /// Whether the hit renderer should assume the beatmap is for the current ruleset. /// Unable to successfully load the beatmap to be usable with this ruleset. /// - public abstract HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset); + public abstract RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset); public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap); diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index cd9089c859..5ccac2db32 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -150,13 +150,13 @@ namespace osu.Game.Rulesets.Scoring { } - protected ScoreProcessor(HitRenderer hitRenderer) + protected ScoreProcessor(RulesetContainer rulesetContainer) { - Judgements.Capacity = hitRenderer.Beatmap.HitObjects.Count; + Judgements.Capacity = rulesetContainer.Beatmap.HitObjects.Count; - hitRenderer.OnJudgement += AddJudgement; + rulesetContainer.OnJudgement += AddJudgement; - ComputeTargets(hitRenderer.Beatmap); + ComputeTargets(rulesetContainer.Beatmap); Reset(); } diff --git a/osu.Game/Rulesets/UI/HitRenderer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs similarity index 84% rename from osu.Game/Rulesets/UI/HitRenderer.cs rename to osu.Game/Rulesets/UI/RulesetContainer.cs index 00f8e8a469..16ea895fac 100644 --- a/osu.Game/Rulesets/UI/HitRenderer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -23,12 +23,12 @@ using osu.Game.Rulesets.Beatmaps; namespace osu.Game.Rulesets.UI { /// - /// Base HitRenderer. Doesn't hold objects. + /// Base RulesetContainer. Doesn't hold objects. /// - /// Should not be derived - derive instead. + /// Should not be derived - derive instead. /// /// - public abstract class HitRenderer : Container + public abstract class RulesetContainer : Container { /// /// Invoked when all the judgeable HitObjects have been judged. @@ -41,12 +41,12 @@ namespace osu.Game.Rulesets.UI public bool AspectAdjust = true; /// - /// The input manager for this HitRenderer. + /// The input manager for this RulesetContainer. /// internal readonly PlayerInputManager InputManager = new PlayerInputManager(); /// - /// The key conversion input manager for this HitRenderer. + /// The key conversion input manager for this RulesetContainer. /// protected readonly PassThroughInputManager KeyConversionInputManager; @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.UI /// A visual representation of a . /// /// The ruleset being repesented. - internal HitRenderer(Ruleset ruleset) + internal RulesetContainer(Ruleset ruleset) { Ruleset = ruleset; KeyConversionInputManager = CreateActionMappingInputManager(); @@ -113,14 +113,14 @@ namespace osu.Game.Rulesets.UI } /// - /// HitRenderer that applies conversion to Beatmaps. Does not contain a Playfield + /// 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 HitRenderer. - public abstract class HitRenderer : HitRenderer + /// The type of HitObject contained by this RulesetContainer. + public abstract class RulesetContainer : RulesetContainer where TObject : HitObject { /// @@ -144,9 +144,9 @@ 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 HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset) + internal RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset) { - Debug.Assert(beatmap != null, "HitRenderer initialized with a null beatmap."); + Debug.Assert(beatmap != null, "RulesetContainer initialized with a null beatmap."); Mods = beatmap.Mods.Value; @@ -180,7 +180,7 @@ namespace osu.Game.Rulesets.UI } /// - /// Applies the active mods to this HitRenderer. + /// Applies the active mods to this RulesetContainer. /// /// private void applyMods(IEnumerable mods) @@ -189,7 +189,7 @@ namespace osu.Game.Rulesets.UI return; foreach (var mod in mods.OfType>()) - mod.ApplyToHitRenderer(this); + mod.ApplyToRulesetContainer(this); } /// @@ -212,11 +212,11 @@ namespace osu.Game.Rulesets.UI } /// - /// A derivable HitRenderer that manages the Playfield and HitObjects. + /// A derivable RulesetContainer that manages the Playfield and HitObjects. /// - /// The type of HitObject contained by this HitRenderer. - /// The type of Judgement of DrawableHitObjects contained by this HitRenderer. - public abstract class HitRenderer : HitRenderer + /// 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 { @@ -247,7 +247,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. - protected HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { InputManager.Add(content = new Container @@ -334,12 +334,12 @@ namespace osu.Game.Rulesets.UI } /// - /// A derivable HitRenderer that manages the Playfield and HitObjects. + /// A derivable RulesetContainer that manages the Playfield and HitObjects. /// - /// The type of Playfield contained by this HitRenderer. - /// The type of HitObject contained by this HitRenderer. - /// The type of Judgement of DrawableHitObjects contained by this HitRenderer. - public abstract class HitRenderer : HitRenderer + /// 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 where TObject : HitObject where TJudgement : Judgement where TPlayfield : Playfield @@ -355,7 +355,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. - protected HitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game/Rulesets/UI/ScrollingHitRenderer.cs b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs similarity index 87% rename from osu.Game/Rulesets/UI/ScrollingHitRenderer.cs rename to osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs index 37df08ba21..64e865473d 100644 --- a/osu.Game/Rulesets/UI/ScrollingHitRenderer.cs +++ b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs @@ -17,22 +17,22 @@ 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 ScrollingHitRenderer : HitRenderer + public abstract class ScrollingRulesetContainer : RulesetContainer where TObject : HitObject where TJudgement : Judgement 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); - protected ScrollingHitRenderer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) + protected ScrollingRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) { } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index ea75c140db..cf6bc03c60 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -90,11 +90,11 @@ namespace osu.Game.Screens.Play } } - public virtual void BindHitRenderer(HitRenderer hitRenderer) + public virtual void BindRulesetContainer(RulesetContainer rulesetContainer) { - hitRenderer.InputManager.Add(KeyCounter.GetReceptor()); + rulesetContainer.InputManager.Add(KeyCounter.GetReceptor()); - replayLoaded = hitRenderer.HasReplayLoaded; + replayLoaded = rulesetContainer.HasReplayLoaded; // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a13e9ed369..00f1bd1b6b 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -32,7 +32,7 @@ namespace osu.Game.Screens.Play internal override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && HitRenderer.ProvidingUserCursor; + internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; public Action RestartRequested; @@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play private RulesetInfo ruleset; private ScoreProcessor scoreProcessor; - protected HitRenderer HitRenderer; + protected RulesetContainer RulesetContainer; #region User Settings @@ -66,7 +66,7 @@ namespace osu.Game.Screens.Play private HUDOverlay hudOverlay; private FailOverlay failOverlay; - private bool loadedSuccessfully => HitRenderer?.Objects.Any() == true; + private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; [BackgroundDependencyLoader(permitNulls: true)] private void load(AudioManager audio, OsuConfigManager config, OsuGame osu) @@ -93,18 +93,18 @@ namespace osu.Game.Screens.Play try { - HitRenderer = rulesetInstance.CreateHitRendererWith(working, ruleset.ID == beatmap.BeatmapInfo.Ruleset.ID); + RulesetContainer = rulesetInstance.CreateRulesetContainerWith(working, ruleset.ID == beatmap.BeatmapInfo.Ruleset.ID); } catch (BeatmapInvalidForRulesetException) { - // we may fail to create a HitRenderer if the beatmap cannot be loaded with the user's preferred ruleset + // we may fail to create a RulesetContainer if the beatmap cannot be loaded with the user's preferred ruleset // let's try again forcing the beatmap's ruleset. ruleset = beatmap.BeatmapInfo.Ruleset; rulesetInstance = ruleset.CreateInstance(); - HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap, true); + RulesetContainer = rulesetInstance.CreateRulesetContainerWith(Beatmap, true); } - if (!HitRenderer.Objects.Any()) + if (!RulesetContainer.Objects.Any()) throw new InvalidOperationException("Beatmap contains no hit objects!"); } catch (Exception e) @@ -119,7 +119,7 @@ namespace osu.Game.Screens.Play adjustableSourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock(); decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; - var firstObjectTime = HitRenderer.Objects.First().StartTime; + var firstObjectTime = RulesetContainer.Objects.First().StartTime; decoupledClock.Seek(Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn))); decoupledClock.ProcessFrame(); @@ -147,7 +147,7 @@ namespace osu.Game.Screens.Play FramedClock = offsetClock, OnRetry = Restart, OnQuit = Exit, - CheckCanPause = () => ValidForResume && !HasFailed && !HitRenderer.HasReplayLoaded, + CheckCanPause = () => ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, Retries = RestartCount, OnPause = () => { hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused; @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play Clock = offsetClock, Children = new Drawable[] { - HitRenderer, + RulesetContainer, } }, hudOverlay = new HUDOverlay @@ -184,27 +184,27 @@ namespace osu.Game.Screens.Play Action = () => { //we want to hide the hitrenderer immediately (looks better). //we may be able to remove this once the mouse cursor trail is improved. - HitRenderer?.Hide(); + RulesetContainer?.Hide(); Restart(); }, } }; - scoreProcessor = HitRenderer.CreateScoreProcessor(); + scoreProcessor = RulesetContainer.CreateScoreProcessor(); hudOverlay.KeyCounter.AddRange(rulesetInstance.CreateGameplayKeys()); hudOverlay.BindProcessor(scoreProcessor); - hudOverlay.BindHitRenderer(HitRenderer); + hudOverlay.BindRulesetContainer(RulesetContainer); - hudOverlay.Progress.Objects = HitRenderer.Objects; + hudOverlay.Progress.Objects = RulesetContainer.Objects; hudOverlay.Progress.AudioClock = decoupledClock; - hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded; + hudOverlay.Progress.AllowSeeking = RulesetContainer.HasReplayLoaded; hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); hudOverlay.ModDisplay.Current.BindTo(working.Mods); - //bind HitRenderer to ScoreProcessor and ourselves (for a pass situation) - HitRenderer.OnAllJudged += onCompletion; + //bind RulesetContainer to ScoreProcessor and ourselves (for a pass situation) + RulesetContainer.OnAllJudged += onCompletion; //bind ScoreProcessor to ourselves (for a fail situation) scoreProcessor.Failed += onFail; @@ -238,7 +238,7 @@ namespace osu.Game.Screens.Play Ruleset = ruleset }; scoreProcessor.PopulateScore(score); - score.User = HitRenderer.Replay?.User ?? (Game as OsuGame)?.API?.LocalUser?.Value; + score.User = RulesetContainer.Replay?.User ?? (Game as OsuGame)?.API?.LocalUser?.Value; Push(new Results(score)); }); } @@ -295,7 +295,7 @@ namespace osu.Game.Screens.Play protected override bool OnExiting(Screen next) { - if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || HitRenderer?.HasReplayLoaded != false) + if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) { fadeOut(); return base.OnExiting(next); @@ -313,7 +313,7 @@ namespace osu.Game.Screens.Play { const float fade_out_duration = 250; - HitRenderer?.FadeOut(fade_out_duration); + RulesetContainer?.FadeOut(fade_out_duration); Content.FadeOut(fade_out_duration); hudOverlay?.ScaleTo(0.7f, fade_out_duration * 3, Easing.In); diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index 860675b62a..4748ddfd71 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play protected override void LoadComplete() { base.LoadComplete(); - HitRenderer.SetReplay(Replay); + RulesetContainer.SetReplay(Replay); } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0a73754e14..482422cfd9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -338,9 +338,9 @@ - + - +