public void Run(ICommandInteraction writer, LiteralToken variable, Token value) { var varName = variable.Value; varName = GetVariableName(varName); SetVariable(varName, value); }
public bool ExecuteBuiltinCommand(Token[] command, ICommandInteraction writer) { var command_name = ((LiteralToken)command[0]).Value; if(!Scope.ContainsVariable("mc_" + command_name)) { return false; } object comm = Scope.GetVariable("mc_" + command_name); // get a method var parameters = command.Skip(1).Select(x => x.GetObjectValue()).ToArray(); ConfigureOutput(writer); try { return ((int)Engine.Operations.Invoke(comm, parameters) == 1); } catch(Exception e) { throw new RecoverableException(e); } }
public void Run(Token token) { // THIS METHOD IS INTENTIONALY LEFT BLANK }
public void Run(ICommandInteraction writer, VariableToken variable, Token value) { Run(writer, new LiteralToken(variable.Value), value); }
public void Run(ICommandInteraction writer, Token[] tokens) { writer.WriteLine("\"" + string.Join(" ", tokens.Select(x=>x.GetObjectValue().ToString())) + "\""); }