Resolve DroppedObjectContainer via DI

This commit is contained in:
ekrctb
2021-06-24 15:56:53 +09:00
parent 16d5893535
commit ae09c23e4e
6 changed files with 54 additions and 34 deletions

View File

@ -26,6 +26,9 @@ namespace osu.Game.Rulesets.Catch.UI
/// </summary>
public const float CENTER_X = WIDTH / 2;
[Cached]
private readonly DroppedObjectContainer droppedObjectContainer;
internal readonly CatcherArea CatcherArea;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
@ -34,9 +37,7 @@ namespace osu.Game.Rulesets.Catch.UI
public CatchPlayfield(BeatmapDifficulty difficulty)
{
var droppedObjectContainer = new DroppedObjectContainer();
CatcherArea = new CatcherArea(droppedObjectContainer, difficulty)
CatcherArea = new CatcherArea(difficulty)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft,
@ -44,7 +45,7 @@ namespace osu.Game.Rulesets.Catch.UI
InternalChildren = new[]
{
droppedObjectContainer,
droppedObjectContainer = new DroppedObjectContainer(),
CatcherArea.MovableCatcher.CreateProxiedContent(),
HitObjectContainer.CreateProxy(),
// This ordering (`CatcherArea` before `HitObjectContainer`) is important to