15 lines
372 B
C#
15 lines
372 B
C#
namespace FoodFactory.Blueprints;
|
|
|
|
using FoodFactory.Core;
|
|
|
|
public readonly record struct BlueprintId
|
|
{
|
|
public readonly int Id;
|
|
public CompiledBlueprint Blueprint() => _registry.GetEntry(Id);
|
|
private static readonly Registry<CompiledBlueprint> _registry = new();
|
|
public BlueprintId(CompiledBlueprint blueprint)
|
|
{
|
|
Id = _registry.GetOrCreate(blueprint);
|
|
}
|
|
}
|