#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 BuyItemPopModelWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(BuyItemPopModel);
|
Utils.BeginObjectRegister(type, L, translator, 0, 6, 2, 1);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetModel", _m_SetModel);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CheckIsVipBuy", _m_CheckIsVipBuy);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CheckIsLimitBuyCnt", _m_CheckIsLimitBuyCnt);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCurBuyCnt", _m_GetCurBuyCnt);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetRemainBuyCnt", _m_GetRemainBuyCnt);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetBuyPrice", _m_GetBuyPrice);
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "storeConfig", _g_get_storeConfig);
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "vipBuyCntDict", _g_get_vipBuyCntDict);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "vipBuyCntDict", _s_set_vipBuyCntDict);
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
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) == 1)
|
{
|
|
BuyItemPopModel gen_ret = new BuyItemPopModel();
|
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 BuyItemPopModel constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetModel(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _shopId = LuaAPI.xlua_tointeger(L, 2);
|
|
gen_to_be_invoked.SetModel( _shopId );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_CheckIsVipBuy(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
TableConfig.StoreConfig _model = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig));
|
int _curVipIndex;
|
int _nextVipIndex;
|
|
bool gen_ret = gen_to_be_invoked.CheckIsVipBuy( _model, out _curVipIndex, out _nextVipIndex );
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
LuaAPI.xlua_pushinteger(L, _curVipIndex);
|
|
LuaAPI.xlua_pushinteger(L, _nextVipIndex);
|
|
|
|
|
return 3;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_CheckIsLimitBuyCnt(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
TableConfig.StoreConfig _model = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig));
|
int _canBuyCnt;
|
int _addBuyCnt;
|
|
bool gen_ret = gen_to_be_invoked.CheckIsLimitBuyCnt( _model, out _canBuyCnt, out _addBuyCnt );
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
LuaAPI.xlua_pushinteger(L, _canBuyCnt);
|
|
LuaAPI.xlua_pushinteger(L, _addBuyCnt);
|
|
|
|
|
return 3;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetCurBuyCnt(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _buyCnt = LuaAPI.xlua_tointeger(L, 2);
|
int _remainBuyCnt = LuaAPI.xlua_tointeger(L, 3);
|
bool _IsReachUpper;
|
|
int gen_ret = gen_to_be_invoked.GetCurBuyCnt( _buyCnt, _remainBuyCnt, out _IsReachUpper );
|
LuaAPI.xlua_pushinteger(L, gen_ret);
|
LuaAPI.lua_pushboolean(L, _IsReachUpper);
|
|
|
|
|
return 2;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetRemainBuyCnt(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _canBuyCnt = LuaAPI.xlua_tointeger(L, 2);
|
BuyShopItemLimit _shopItemLimit = (BuyShopItemLimit)translator.GetObject(L, 3, typeof(BuyShopItemLimit));
|
bool _isVipBuy = LuaAPI.lua_toboolean(L, 4);
|
|
int gen_ret = gen_to_be_invoked.GetRemainBuyCnt( _canBuyCnt, _shopItemLimit, _isVipBuy );
|
LuaAPI.xlua_pushinteger(L, gen_ret);
|
|
|
|
return 1;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetBuyPrice(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
TableConfig.StoreConfig _model = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig));
|
int _buyCnt = LuaAPI.xlua_tointeger(L, 3);
|
|
int gen_ret = gen_to_be_invoked.GetBuyPrice( _model, _buyCnt );
|
LuaAPI.xlua_pushinteger(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_storeConfig(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.storeConfig);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_vipBuyCntDict(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.vipBuyCntDict);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_vipBuyCntDict(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
BuyItemPopModel gen_to_be_invoked = (BuyItemPopModel)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.vipBuyCntDict = (System.Collections.Generic.Dictionary<int, int>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<int, int>));
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 0;
|
}
|
|
|
|
|
|
}
|
}
|