#if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using XLua; using System.Collections.Generic; namespace XLua.CSObjectWrap { using Utils = XLua.Utils; public class IronSourceBannerSizeWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(IronSourceBannerSize); Utils.BeginObjectRegister(type, L, translator, 0, 2, 3, 0); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAdaptive", _m_SetAdaptive); Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsAdaptiveEnabled", _m_IsAdaptiveEnabled); Utils.RegisterFunc(L, Utils.GETTER_IDX, "Description", _g_get_Description); Utils.RegisterFunc(L, Utils.GETTER_IDX, "Width", _g_get_Width); Utils.RegisterFunc(L, Utils.GETTER_IDX, "Height", _g_get_Height); Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); Utils.BeginClassRegister(type, L, __CreateInstance, 1, 4, 4); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "BANNER", _g_get_BANNER); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "LARGE", _g_get_LARGE); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "RECTANGLE", _g_get_RECTANGLE); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "SMART", _g_get_SMART); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "BANNER", _s_set_BANNER); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "LARGE", _s_set_LARGE); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "RECTANGLE", _s_set_RECTANGLE); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "SMART", _s_set_SMART); Utils.EndClassRegister(type, L, translator); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if(LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { int _width = LuaAPI.xlua_tointeger(L, 2); int _height = LuaAPI.xlua_tointeger(L, 3); var gen_ret = new IronSourceBannerSize(_width, _height); translator.Push(L, gen_ret); return 1; } if(LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) { string _description = LuaAPI.lua_tostring(L, 2); var gen_ret = new IronSourceBannerSize(_description); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to IronSourceBannerSize constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_SetAdaptive(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize gen_to_be_invoked = (IronSourceBannerSize)translator.FastGetCSObj(L, 1); { bool _adaptive = LuaAPI.lua_toboolean(L, 2); gen_to_be_invoked.SetAdaptive( _adaptive ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_IsAdaptiveEnabled(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize gen_to_be_invoked = (IronSourceBannerSize)translator.FastGetCSObj(L, 1); { var gen_ret = gen_to_be_invoked.IsAdaptiveEnabled( ); LuaAPI.lua_pushboolean(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_Description(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize gen_to_be_invoked = (IronSourceBannerSize)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushstring(L, gen_to_be_invoked.Description); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_Width(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize gen_to_be_invoked = (IronSourceBannerSize)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.Width); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_Height(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize gen_to_be_invoked = (IronSourceBannerSize)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.Height); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_BANNER(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); translator.Push(L, IronSourceBannerSize.BANNER); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_LARGE(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); translator.Push(L, IronSourceBannerSize.LARGE); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_RECTANGLE(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); translator.Push(L, IronSourceBannerSize.RECTANGLE); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_SMART(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); translator.Push(L, IronSourceBannerSize.SMART); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_BANNER(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize.BANNER = (IronSourceBannerSize)translator.GetObject(L, 1, typeof(IronSourceBannerSize)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_LARGE(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize.LARGE = (IronSourceBannerSize)translator.GetObject(L, 1, typeof(IronSourceBannerSize)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_RECTANGLE(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize.RECTANGLE = (IronSourceBannerSize)translator.GetObject(L, 1, typeof(IronSourceBannerSize)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_SMART(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); IronSourceBannerSize.SMART = (IronSourceBannerSize)translator.GetObject(L, 1, typeof(IronSourceBannerSize)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } } }