示例#1
0
 public void Run(ICommandInteraction writer, LiteralToken variable, Token value)
 {
     var varName = variable.Value;
    
     varName = GetVariableName(varName);
     SetVariable(varName, value);
 }
示例#2
0
        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);
            }
        }
示例#3
0
 public void Run(Token token)
 {
     // THIS METHOD IS INTENTIONALY LEFT BLANK
 }
示例#4
0
 public void Run(ICommandInteraction writer, VariableToken variable, Token value)
 {
     Run(writer, new LiteralToken(variable.Value), value);
 }
示例#5
0
 public void Run(ICommandInteraction writer, Token[] tokens)
 {
     writer.WriteLine("\"" + string.Join(" ", tokens.Select(x=>x.GetObjectValue().ToString())) + "\"");
 }