21 lines
591 B
C#
21 lines
591 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|