Exemplo n.º 1
0
        // Additional overload provided because ExposedList<T> only implements IEnumerable<T>,
        // leading to sub-optimal behavior: It grows multiple times as it assumes not
        // to know the final size ahead of insertion.
        public void AddRange(ExposedList <T> list)
        {
            CheckCollection(list);

            int collectionCount = list.Count;

            if (collectionCount == 0)
            {
                return;
            }

            GrowIfNeeded(collectionCount);
            list.CopyTo(Items, Count);
            Count += collectionCount;

            version++;
        }
    static int CopyTo(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                Spine.Animation[] arg0 = ToLua.CheckObjectArray <Spine.Animation>(L, 2);
                obj.CopyTo(arg0);
                return(0);
            }
            else if (count == 3)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                Spine.Animation[] arg0 = ToLua.CheckObjectArray <Spine.Animation>(L, 2);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                obj.CopyTo(arg0, arg1);
                return(0);
            }
            else if (count == 5)
            {
                Spine.ExposedList <Spine.Animation> obj = (Spine.ExposedList <Spine.Animation>)ToLua.CheckObject <Spine.ExposedList <Spine.Animation> >(L, 1);
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                Spine.Animation[] arg1 = ToLua.CheckObjectArray <Spine.Animation>(L, 3);
                int arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                obj.CopyTo(arg0, arg1, arg2, arg3);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Spine.ExposedList<Spine.Animation>.CopyTo"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }