static int BinarySearch(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <EventDelegate>), typeof(EventDelegate)))
            {
                System.Collections.Generic.List <EventDelegate> obj = (System.Collections.Generic.List <EventDelegate>)ToLua.ToObject(L, 1);
                EventDelegate arg0 = (EventDelegate)ToLua.ToObject(L, 2);
                int           o    = obj.BinarySearch(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <EventDelegate>), typeof(EventDelegate), typeof(System.Collections.Generic.IComparer <EventDelegate>)))
            {
                System.Collections.Generic.List <EventDelegate> obj = (System.Collections.Generic.List <EventDelegate>)ToLua.ToObject(L, 1);
                EventDelegate arg0 = (EventDelegate)ToLua.ToObject(L, 2);
                System.Collections.Generic.IComparer <EventDelegate> arg1 = (System.Collections.Generic.IComparer <EventDelegate>)ToLua.ToObject(L, 3);
                int o = obj.BinarySearch(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(System.Collections.Generic.List <EventDelegate>), typeof(int), typeof(int), typeof(EventDelegate), typeof(System.Collections.Generic.IComparer <EventDelegate>)))
            {
                System.Collections.Generic.List <EventDelegate> obj = (System.Collections.Generic.List <EventDelegate>)ToLua.ToObject(L, 1);
                int           arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                int           arg1 = (int)LuaDLL.lua_tonumber(L, 3);
                EventDelegate arg2 = (EventDelegate)ToLua.ToObject(L, 4);
                System.Collections.Generic.IComparer <EventDelegate> arg3 = (System.Collections.Generic.IComparer <EventDelegate>)ToLua.ToObject(L, 5);
                int o = obj.BinarySearch(arg0, arg1, arg2, arg3);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: System.Collections.Generic.List<EventDelegate>.BinarySearch"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #2
0
    static int BinarySearch(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                System.Collections.Generic.List <uint> obj = (System.Collections.Generic.List <uint>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <uint>));
                uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
                int  o    = obj.BinarySearch(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3)
            {
                System.Collections.Generic.List <uint> obj = (System.Collections.Generic.List <uint>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <uint>));
                uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
                System.Collections.Generic.IComparer <uint> arg1 = (System.Collections.Generic.IComparer <uint>)ToLua.CheckObject <System.Collections.Generic.IComparer <uint> >(L, 3);
                int o = obj.BinarySearch(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 5)
            {
                System.Collections.Generic.List <uint> obj = (System.Collections.Generic.List <uint>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <uint>));
                int  arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                int  arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                uint arg2 = (uint)LuaDLL.luaL_checknumber(L, 4);
                System.Collections.Generic.IComparer <uint> arg3 = (System.Collections.Generic.IComparer <uint>)ToLua.CheckObject <System.Collections.Generic.IComparer <uint> >(L, 5);
                int o = obj.BinarySearch(arg0, arg1, arg2, arg3);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: System.Collections.Generic.List<uint>.BinarySearch"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #3
0
 public int BinarySearch(T item)
 => _list.BinarySearch(item);
예제 #4
0
 public int BinarySearch(T item)
 {
     return(data.BinarySearch(item, comparer));
 }