♻️ Rebuild with DI
This commit is contained in:
@@ -8,9 +8,9 @@ namespace AceFieldNewHorizon.Scripts.System;
|
||||
|
||||
public partial class PlacementManager : Node2D
|
||||
{
|
||||
[Export] public GridManager Grid { get; set; }
|
||||
[Export] public ResourceManager Inventory { get; set; }
|
||||
[Export] public BuildingRegistry Registry { get; set; }
|
||||
public GridManager Grid { get; private set; }
|
||||
public ResourceManager Inventory { get; private set; }
|
||||
public BuildingRegistry Registry { get; private set; }
|
||||
|
||||
[Export] public int MaxConcurrentBuilds { get; set; } = 6; // Make it adjustable in editor
|
||||
[Export] public bool Enabled { get; set; } = true;
|
||||
@@ -30,6 +30,10 @@ public partial class PlacementManager : Node2D
|
||||
{
|
||||
base._Ready();
|
||||
|
||||
Grid = DependencyInjection.Container.GetInstance<GridManager>();
|
||||
Inventory = DependencyInjection.Container.GetInstance<ResourceManager>();
|
||||
Registry = DependencyInjection.Container.GetInstance<BuildingRegistry>();
|
||||
|
||||
// Setup completion sound
|
||||
_completionSound = CreateAudioPlayer("res://Sounds/Events/ConstructionComplete.wav");
|
||||
_buildingSound = CreateAudioPlayer("res://Sounds/Events/Building.wav");
|
||||
|
Reference in New Issue
Block a user