Files
basic-computer-games/84 Super Star Trek/csharp/CommandExtensions.cs
2021-02-27 17:32:04 +11:00

15 lines
374 B
C#

using System.Reflection;
using System.ComponentModel;
namespace SuperStarTrek
{
internal static class CommandExtensions
{
internal static string GetDescription(this Command command) =>
typeof(Command)
.GetField(command.ToString())
.GetCustomAttribute<DescriptionAttribute>()
.Description;
}
}