Seprated many files, removed IDataCompiler with using YamlConverters. Refactored namespaces
This commit is contained in:
14
src/Blueprints/BlueprintId.cs
Normal file
14
src/Blueprints/BlueprintId.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user