From d3e38f5e5aeeeb7c88ca2e7c5ff507c8dd82ba02 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 16 Oct 2019 20:10:03 +0900 Subject: [PATCH] Make the editor beatmap protected --- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index a267d7c44d..bf31b76dc4 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -30,12 +30,11 @@ namespace osu.Game.Rulesets.Edit where TObject : HitObject { protected IRulesetConfigManager Config { get; private set; } - + protected EditorBeatmap EditorBeatmap { get; private set; } protected readonly Ruleset Ruleset; private IWorkingBeatmap workingBeatmap; private Beatmap playableBeatmap; - private EditorBeatmap editorBeatmap; private IBeatmapProcessor beatmapProcessor; private DrawableEditRulesetWrapper drawableRulesetWrapper; @@ -129,14 +128,14 @@ namespace osu.Game.Rulesets.Edit beatmapProcessor = Ruleset.CreateBeatmapProcessor(playableBeatmap); - editorBeatmap = new EditorBeatmap(playableBeatmap); - editorBeatmap.HitObjectAdded += addHitObject; - editorBeatmap.HitObjectRemoved += removeHitObject; - editorBeatmap.StartTimeChanged += updateHitObject; + EditorBeatmap = new EditorBeatmap(playableBeatmap); + EditorBeatmap.HitObjectAdded += addHitObject; + EditorBeatmap.HitObjectRemoved += removeHitObject; + EditorBeatmap.StartTimeChanged += updateHitObject; var dependencies = new DependencyContainer(parent); - dependencies.CacheAs(editorBeatmap); - dependencies.CacheAs>(editorBeatmap); + dependencies.CacheAs(EditorBeatmap); + dependencies.CacheAs>(EditorBeatmap); Config = dependencies.Get().GetConfigFor(Ruleset); @@ -189,18 +188,18 @@ namespace osu.Game.Rulesets.Edit { } - public void EndPlacement(HitObject hitObject) => editorBeatmap.Add(hitObject); + public void EndPlacement(HitObject hitObject) => EditorBeatmap.Add(hitObject); - public void Delete(HitObject hitObject) => editorBeatmap.Remove(hitObject); + public void Delete(HitObject hitObject) => EditorBeatmap.Remove(hitObject); protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - if (editorBeatmap != null) + if (EditorBeatmap != null) { - editorBeatmap.HitObjectAdded -= addHitObject; - editorBeatmap.HitObjectRemoved -= removeHitObject; + EditorBeatmap.HitObjectAdded -= addHitObject; + EditorBeatmap.HitObjectRemoved -= removeHitObject; } } }