mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
15 lines
383 B
C#
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;
|
|
}
|
|
}
|