You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
741 B
29 lines
741 B
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;
|
|
}
|
|
|
|
} |