public void RunAllCommands() { if (PendingCommand != null) { AddCommandToExecute(PendingCommand); PendingCommand = null; } foreach (var command in _commandsToExecute) { command.Run.Invoke(); if(command.Parameters!=null) Array.Clear(command.Parameters,0,command.Parameters.Length); } _commandsToExecute.Clear(); }
private void AddAllowedCommand(Command commandToAdd) { foreach (var sign in commandToAdd.Signature.Split(' ')) AllowedCommands.Add(sign, commandToAdd); }
public void AddCommandToExecute(Command command) { _commandsToExecute.Add(command); }
private Command command; // remains null if CommandBuilder receives invalid argument #endregion Fields #region Constructors //Asks CommandBuilder to create an instance for Command public Flag(string name) { command = builder.Create(name); commandArgs = new List<string>(); }