#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 PlayerStoneDataWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(PlayerStoneData);
|
Utils.BeginObjectRegister(type, L, translator, 0, 5, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshData", _m_RefreshData);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetStoneInfo", _m_GetStoneInfo);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetStoneBindInfo", _m_GetStoneBindInfo);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetAllStone", _m_GetAllStone);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetAllStoneLv", _m_GetAllStoneLv);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
null, null, null);
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 2, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "OnRefreshStoneData", _e_OnRefreshStoneData);
|
|
|
|
|
|
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)
|
{
|
|
PlayerStoneData gen_ret = new PlayerStoneData();
|
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 PlayerStoneData constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_RefreshData(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
PlayerStoneData gen_to_be_invoked = (PlayerStoneData)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
HA3BC_tagMCStoneInfo _vNetData = (HA3BC_tagMCStoneInfo)translator.GetObject(L, 2, typeof(HA3BC_tagMCStoneInfo));
|
|
gen_to_be_invoked.RefreshData( _vNetData );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetStoneInfo(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
PlayerStoneData gen_to_be_invoked = (PlayerStoneData)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _index = LuaAPI.xlua_tointeger(L, 2);
|
|
uint[] gen_ret = gen_to_be_invoked.GetStoneInfo( _index );
|
translator.Push(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_GetStoneBindInfo(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
PlayerStoneData gen_to_be_invoked = (PlayerStoneData)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int _index = LuaAPI.xlua_tointeger(L, 2);
|
|
byte[] gen_ret = gen_to_be_invoked.GetStoneBindInfo( _index );
|
LuaAPI.lua_pushstring(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_GetAllStone(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
PlayerStoneData gen_to_be_invoked = (PlayerStoneData)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
System.Collections.Generic.Dictionary<int, uint[]> gen_ret = gen_to_be_invoked.GetAllStone( );
|
translator.Push(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_GetAllStoneLv(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
PlayerStoneData gen_to_be_invoked = (PlayerStoneData)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
int gen_ret = gen_to_be_invoked.GetAllStoneLv( );
|
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 _e_OnRefreshStoneData(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 2);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#2 need System.Action!");
|
}
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
|
PlayerStoneData.OnRefreshStoneData += gen_delegate;
|
return 0;
|
}
|
|
|
if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
|
PlayerStoneData.OnRefreshStoneData -= gen_delegate;
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return LuaAPI.luaL_error(L, "invalid arguments to PlayerStoneData.OnRefreshStoneData!");
|
}
|
|
}
|
}
|