Files
mixtape/zero.Core/Architecture/Blueprints/BlueprintOptions.cs
T
2021-11-20 13:52:28 +01:00

31 lines
579 B
C#

namespace zero.Architecture;
public class BlueprintOptions : OptionsEnumerable<Blueprint>, IOptionsEnumerable
{
public BlueprintOptions()
{
Enabled = false;
}
public bool Enabled { get; set; }
public void Add<T>() where T : Blueprint, new()
{
Items.Add(new T());
}
public void Add<T>(Blueprint<T> implementation) where T : ZeroEntity, new()
{
Items.Add(implementation);
}
public void Add<T>(Action<Blueprint<T>> createExpression = null) where T : ZeroEntity, new()
{
Items.Add(new DefaultBlueprint<T>(createExpression));
}
}