mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Remove IPlayfieldProvider
by caching Playfield
This commit is contained in:
@ -43,6 +43,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
protected readonly Ruleset Ruleset;
|
||||
|
||||
// Provides `Playfield`
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
[Resolved]
|
||||
protected EditorClock EditorClock { get; private set; }
|
||||
|
||||
@ -69,6 +72,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
Ruleset = ruleset;
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
|
||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -88,6 +94,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
return;
|
||||
}
|
||||
|
||||
dependencies.CacheAs(Playfield);
|
||||
|
||||
const float toolbar_width = 200;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
@ -415,8 +423,7 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// </summary>
|
||||
[Cached(typeof(HitObjectComposer))]
|
||||
[Cached(typeof(IPositionSnapProvider))]
|
||||
[Cached(typeof(IPlayfieldProvider))]
|
||||
public abstract class HitObjectComposer : CompositeDrawable, IPositionSnapProvider, IPlayfieldProvider
|
||||
public abstract class HitObjectComposer : CompositeDrawable, IPositionSnapProvider
|
||||
{
|
||||
protected HitObjectComposer()
|
||||
{
|
||||
|
@ -1,12 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Edit
|
||||
{
|
||||
public interface IPlayfieldProvider
|
||||
{
|
||||
Playfield Playfield { get; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user