public static int Bxor(LuaArguments args) { return(args.Select(o => o.AsInt()).Aggregate((l, r) => l ^ r)); }
// The following types will be automatically added without the need of providing them in Lua: // CancellationToken - The token that was given in "engine.ExecuteAsync" or "func.CallAsync". // LuaArguments - All the arguments given by Lua. // Engine - The engine that called the method. public static void Notice(Engine engine, LuaArguments args) { Console.WriteLine($"The engine {engine} said: {string.Join(", ", args.Select(a => a.AsString()))}"); }
private static LuaArguments print(LuaArguments args) { Console.WriteLine(string.Join("\t", args.Select(x => x.ToString()).ToArray())); return Lua.Return(); }
public static string Char(LuaArguments args) { return(new string(args.Select(o => (char)o.AsNumber()).ToArray())); }