public static bool CheckEnum <T>(IntPtr ptr, int p, out T o) where T : struct { int i = (int)LuaNativeMethods.luaL_checkinteger(ptr, p); o = (T)Enum.ToObject(typeof(T), i); return(true); }
public static bool CheckType(IntPtr ptr, int p, out byte v) { v = (byte)LuaNativeMethods.luaL_checkinteger(ptr, p); return(true); }
// why doesn't have a checkArray<byte[]> function accept lua string? // I think you should did a Buffer class to wrap byte[] pass/accept between mono and lua vm public static bool CheckType(IntPtr ptr, int p, out char c) { c = (char)LuaNativeMethods.luaL_checkinteger(ptr, p); return(true); }