From 6445bea864d2bd3fdd3e0f9fc21186a65569857e Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 11 May 2017 14:43:57 +0900 Subject: [PATCH] Make Playfield.HitObjects internal to playfields. Because not all playfields will be using this. --- osu.Game/Rulesets/UI/HitRenderer.cs | 11 ++++++++--- osu.Game/Rulesets/UI/Playfield.cs | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/UI/HitRenderer.cs b/osu.Game/Rulesets/UI/HitRenderer.cs index 8ee67df95a..4ca77f71df 100644 --- a/osu.Game/Rulesets/UI/HitRenderer.cs +++ b/osu.Game/Rulesets/UI/HitRenderer.cs @@ -187,17 +187,19 @@ namespace osu.Game.Rulesets.UI public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor; - protected override Container Content => content; - protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None); + public override IEnumerable Objects => Beatmap.HitObjects; + + protected override bool AllObjectsJudged => drawableObjects.All(h => h.Judgement.Result != HitResult.None); /// /// The playfield. /// protected Playfield Playfield; + protected override Container Content => content; private readonly Container content; - public override IEnumerable Objects => Beatmap.HitObjects; + private List> drawableObjects; protected HitRenderer(WorkingBeatmap beatmap) : base(beatmap) @@ -224,6 +226,8 @@ namespace osu.Game.Rulesets.UI private void loadObjects() { + drawableObjects = new List>(Beatmap.HitObjects.Count); + foreach (TObject h in Beatmap.HitObjects) { var drawableObject = GetVisualRepresentation(h); @@ -233,6 +237,7 @@ namespace osu.Game.Rulesets.UI drawableObject.OnJudgement += onJudgement; + drawableObjects.Add(drawableObject); Playfield.Add(drawableObject); } diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 0586c0385a..612569a9ae 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.UI /// /// The HitObjects contained in this Playfield. /// - public HitObjectContainer> HitObjects; + protected HitObjectContainer> HitObjects; internal Container ScaledContent;