Files
basic-computer-games/84 Super Star Trek/csharp/Commands/CommandExtensions.cs
2021-03-02 15:24:23 +11:00

15 lines
383 B
C#

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