♻️ Rebuild with DI
This commit is contained in:
@@ -40,15 +40,15 @@ public record BuildingData(
|
||||
}
|
||||
}
|
||||
|
||||
public partial class BuildingRegistry : Node
|
||||
public class BuildingRegistry
|
||||
{
|
||||
private Dictionary<string, BuildingData> _registry = new();
|
||||
|
||||
[Export] public string JsonPath { get; set; } = "res://Data/Buildings.json";
|
||||
|
||||
|
||||
public override void _Ready()
|
||||
public BuildingRegistry(string jsonPath)
|
||||
{
|
||||
LoadFromJson(JsonPath);
|
||||
LoadFromJson(jsonPath);
|
||||
}
|
||||
|
||||
public void LoadFromJson(string path)
|
||||
|
Reference in New Issue
Block a user