/// <summary> Executes a command with the given name. </summary> /// <param name="commandName"> The name of the command (see <see cref="ECommandName"/>). </param> public void ExecuteCommand(ECommandName commandName) => GetCommand(commandName)?.Execute(this);
/// <summary> Creates a new command. </summary> /// <param name="name"> The name of the command. </param> public Command(ECommandName name) { Name = name; }
/// <summary> Gets a command with the given name. </summary> /// <param name="commandName"> The name of the command (see <see cref="ECommandName"/>). </param> public ICustomCommand GetCommand(ECommandName commandName) => Strategy?.GetCommand(commandName);
/// <summary> Returns a command with the given name, if available. </summary> /// <param name="commandName"> The name of the command. </param> /// <returns></returns> public ICustomCommand GetCommand(ECommandName commandName) => _commands.TryGetValue(commandName, out var command) ? command : null;