static int ChangeMean(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard arg0 = (DuelCard)ToLua.CheckObject <DuelCard>(L, 2); obj.ChangeMean(arg0); return(0); } else if (count == 3) { DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard arg0 = (DuelCard)ToLua.CheckObject <DuelCard>(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.ChangeMean(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: DuelEvent.ChangeMean")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SpecialSummon(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes <DuelCard>(L, 2)) { DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard arg0 = (DuelCard)ToLua.ToObject(L, 2); obj.SpecialSummon(arg0); return(0); } else if (count == 2 && TypeChecker.CheckTypes <System.Collections.Generic.List <DuelCard> >(L, 2)) { DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); System.Collections.Generic.List <DuelCard> arg0 = (System.Collections.Generic.List <DuelCard>)ToLua.ToObject(L, 2); obj.SpecialSummon(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: DuelEvent.SpecialSummon")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetDuelEffect(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); obj.SetDuelEffect(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int DisCard(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); System.Collections.Generic.List <DuelCard> arg0 = (System.Collections.Generic.List <DuelCard>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <DuelCard>)); obj.DisCard(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ThisCardIsBattle(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); bool o = obj.ThisCardIsBattle(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetAntiMonster(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard o = obj.GetAntiMonster(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetThisEffect(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.SetThisEffect(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetPlayerOrder(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); System.Collections.Generic.List <int> o = obj.GetPlayerOrder(); ToLua.PushSealed(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetThisCard(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard arg0 = (DuelCard)ToLua.CheckObject <DuelCard>(L, 2); obj.SetThisCard(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ActivateInvalid(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); DuelCard o = obj.ActivateInvalid(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int DisCardAll(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int o = obj.DisCardAll(arg0); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int CreateEffect(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); CardEffect o = obj.CreateEffect(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int DrawCardAlone(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.DrawCardAlone(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_thiseffect(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; CardEffect ret = obj.thiseffect; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index thiseffect on a nil value")); } }
static int InTimePoint(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); object arg0 = ToLua.ToVarObject(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); bool o = obj.InTimePoint(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_precheck(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; bool ret = obj.precheck; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index precheck on a nil value")); } }
static int get_duelData(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; DuelDataManager ret = obj.duelData; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index duelData on a nil value")); } }
static int SelectCard(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); DuelEvent obj = (DuelEvent)ToLua.CheckObject <DuelEvent>(L, 1); TargetCard arg0 = (TargetCard)ToLua.CheckObject <TargetCard>(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); int arg2 = (int)LuaDLL.luaL_checknumber(L, 4); obj.SelectCard(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_precheck(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.precheck = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index precheck on a nil value")); } }
static int set_thiseffect(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; CardEffect arg0 = (CardEffect)ToLua.CheckObject <CardEffect>(L, 2); obj.thiseffect = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index thiseffect on a nil value")); } }
static int set_duelData(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DuelEvent obj = (DuelEvent)o; DuelDataManager arg0 = (DuelDataManager)ToLua.CheckObject <DuelDataManager>(L, 2); obj.duelData = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index duelData on a nil value")); } }
public void SendEvent(DuelEvent e, params object[] args) { List <DuelEventHandler> nullList = new List <DuelEventHandler>(); foreach (var item in handlerList[(int)e]) { if (objDic[item] == null) { nullList.Add(item); } else { item(args); } } foreach (var item in nullList) { handlerList[(int)e].Remove(item); } }
/// <summary> /// Creates duel event arguments. /// </summary> /// <param name="duelEvent">Event that occurred during duel.</param> public DuelEventArgs(DuelEvent duelEvent) { DuelEvent = duelEvent; }
protected void AddHandler(DuelEvent val, DuelEventHandler handler) { eventSys.AddHandler(val, handler, gameObject); dic.Add(val, handler); }
public void AddHandler(DuelEvent e, DuelEventHandler handler, GameObject obj) { val++; objDic.Add(handler, obj); handlerList[(int)e].Add(handler); }
protected void SendEvent(DuelEvent e, params object[] val) { eventSys.SendEvent(e, val); }
public void DeleteHandler(DuelEvent e, DuelEventHandler handler) { val--; handlerList[(int)e].Remove(handler); }