mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
14 lines
349 B
C#
14 lines
349 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;
|
|
}
|