1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:42:56 +08:00

Introduce IPlayfieldProvider

This commit is contained in:
ekrctb 2021-06-15 14:43:04 +09:00
parent d0e57f7dd9
commit ef96ceb4ab
3 changed files with 16 additions and 3 deletions

View File

@ -14,12 +14,12 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
where T : ManiaHitObject
{
[Resolved]
private HitObjectComposer composer { get; set; }
private IPlayfieldProvider playfieldProvider { get; set; }
[Resolved]
private IScrollingInfo scrollingInfo { get; set; }
protected ScrollingHitObjectContainer HitObjectContainer => ((ManiaPlayfield)composer.Playfield).GetColumn(HitObject.Column).HitObjectContainer;
protected ScrollingHitObjectContainer HitObjectContainer => ((ManiaPlayfield)playfieldProvider.Playfield).GetColumn(HitObject.Column).HitObjectContainer;
protected ManiaSelectionBlueprint(T hitObject)
: base(hitObject)

View File

@ -415,7 +415,8 @@ namespace osu.Game.Rulesets.Edit
/// </summary>
[Cached(typeof(HitObjectComposer))]
[Cached(typeof(IPositionSnapProvider))]
public abstract class HitObjectComposer : CompositeDrawable, IPositionSnapProvider
[Cached(typeof(IPlayfieldProvider))]
public abstract class HitObjectComposer : CompositeDrawable, IPositionSnapProvider, IPlayfieldProvider
{
protected HitObjectComposer()
{

View File

@ -0,0 +1,12 @@
// 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; }
}
}