WIP moving seed to plant matching into separate system, making fields independent of specific plants.

This commit is contained in:
2025-08-15 18:42:17 +02:00
parent c863b35904
commit d36b9d56e7
13 changed files with 135 additions and 134 deletions
@@ -0,0 +1,29 @@
using Babushka.scripts.CSharp.Common.Inventory;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Farming;
public partial class SeedRepository : Node
{
public static SeedRepository Instance { get; private set; } = null!;
// todo: Find out how to not use PackedScene here because it does not inherit from Node
[Export] private Dictionary<ItemResource, PackedScene> seedToPlantRepository;
public override void _EnterTree()
{
Instance = this;
}
public PackedScene? GetPlant(ItemResource resource)
{
if (seedToPlantRepository.ContainsKey(resource))
{
return seedToPlantRepository[resource];
}
return null;
}
}