bfr/BFR/Operations/OperationType.cs

21 lines
591 B
C#
Raw Permalink Normal View History

using System;
namespace BFR.Operations
{
public class OperationType
{
public string Name { get; }
public string Description { get; }
public Func<Operation> Create { get; }
internal static OperationType Make<T>() where T : Operation, new()
{
var pilot = new T();
return new OperationType(pilot.Name, pilot.Description, () => new T());
}
private OperationType(string name, string description, Func<Operation> create) =>
(Name, Description, Create) = (name, description, create);
}
}