mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Pass DroppedObjectContainer
via constructor instead of DI
It is now just one level deep, so it is not beneficial to use DI here.
This effectively reverts ae09c23e
.
This commit is contained in:
@ -35,21 +35,19 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
internal readonly CatcherArea CatcherArea;
|
||||
|
||||
[Cached]
|
||||
private readonly DroppedObjectContainer droppedObjectContainer;
|
||||
|
||||
public CatchPlayfield(BeatmapDifficulty difficulty)
|
||||
{
|
||||
var trailContainer = new Container();
|
||||
var droppedObjectContainer = new DroppedObjectContainer();
|
||||
|
||||
Catcher = new Catcher(trailContainer, difficulty)
|
||||
Catcher = new Catcher(trailContainer, droppedObjectContainer, difficulty)
|
||||
{
|
||||
X = CENTER_X
|
||||
};
|
||||
|
||||
InternalChildren = new[]
|
||||
{
|
||||
droppedObjectContainer = new DroppedObjectContainer(),
|
||||
droppedObjectContainer,
|
||||
Catcher.CreateProxiedContent(),
|
||||
HitObjectContainer.CreateProxy(),
|
||||
// This ordering (`CatcherArea` before `HitObjectContainer`) is important to
|
||||
@ -58,7 +56,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
MovableCatcher = Catcher
|
||||
MovableCatcher = Catcher,
|
||||
},
|
||||
trailContainer,
|
||||
HitObjectContainer,
|
||||
|
@ -74,8 +74,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
/// <summary>
|
||||
/// Contains objects dropped from the plate.
|
||||
/// </summary>
|
||||
[Resolved]
|
||||
private DroppedObjectContainer droppedObjectTarget { get; set; }
|
||||
private readonly DroppedObjectContainer droppedObjectTarget;
|
||||
|
||||
public CatcherAnimationState CurrentState
|
||||
{
|
||||
@ -134,9 +133,10 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
private readonly DrawablePool<CaughtBanana> caughtBananaPool;
|
||||
private readonly DrawablePool<CaughtDroplet> caughtDropletPool;
|
||||
|
||||
public Catcher([NotNull] Container trailsTarget, BeatmapDifficulty difficulty = null)
|
||||
public Catcher([NotNull] Container trailsTarget, DroppedObjectContainer droppedObjectTarget, BeatmapDifficulty difficulty = null)
|
||||
{
|
||||
this.trailsTarget = trailsTarget;
|
||||
this.droppedObjectTarget = droppedObjectTarget;
|
||||
|
||||
Origin = Anchor.TopCentre;
|
||||
|
||||
|
Reference in New Issue
Block a user