예제 #1
0
    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));
        }
    }
예제 #2
0
    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));
        }
    }
예제 #3
0
 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));
     }
 }
예제 #4
0
 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));
     }
 }
예제 #5
0
 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));
     }
 }
예제 #6
0
 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));
     }
 }
예제 #7
0
 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));
     }
 }
예제 #8
0
 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));
     }
 }
예제 #9
0
 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));
     }
 }
예제 #10
0
 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));
     }
 }
예제 #11
0
 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));
     }
 }
예제 #12
0
 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));
     }
 }
예제 #13
0
 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));
     }
 }
예제 #14
0
    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"));
        }
    }
예제 #15
0
 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));
     }
 }
예제 #16
0
    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"));
        }
    }
예제 #17
0
    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"));
        }
    }
예제 #18
0
 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));
     }
 }
예제 #19
0
    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"));
        }
    }
예제 #20
0
    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"));
        }
    }
예제 #21
0
    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"));
        }
    }
예제 #22
0
    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);
        }
    }
예제 #23
0
 /// <summary>
 /// Creates duel event arguments.
 /// </summary>
 /// <param name="duelEvent">Event that occurred during duel.</param>
 public DuelEventArgs(DuelEvent duelEvent)
 {
     DuelEvent = duelEvent;
 }
예제 #24
0
 protected void AddHandler(DuelEvent val, DuelEventHandler handler)
 {
     eventSys.AddHandler(val, handler, gameObject);
     dic.Add(val, handler);
 }
예제 #25
0
 public void AddHandler(DuelEvent e, DuelEventHandler handler, GameObject obj)
 {
     val++;
     objDic.Add(handler, obj);
     handlerList[(int)e].Add(handler);
 }
예제 #26
0
 protected void SendEvent(DuelEvent e, params object[] val)
 {
     eventSys.SendEvent(e, val);
 }
예제 #27
0
 public void DeleteHandler(DuelEvent e, DuelEventHandler handler)
 {
     val--;
     handlerList[(int)e].Remove(handler);
 }