public static int ClearInitedData(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            dataSectionBag.ClearInitedData();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int RemoveAllBagItems(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            dataSectionBag.RemoveAllBagItems();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int get_Bag(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, dataSectionBag.Bag);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag o = new DataSectionBag();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int SerializeMultipleToClient(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            List <object>  o = dataSectionBag.SerializeMultipleToClient();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int IterateAllBagItems(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag            dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            IEnumerable <BagItemBase> o = dataSectionBag.IterateAllBagItems();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int GetAllBagItems(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag     dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            List <BagItemBase> allBagItems    = dataSectionBag.GetAllBagItems();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, allBagItems);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int InitBagItem(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            BagItemBase    bagItem;
            LuaObject.checkType <BagItemBase>(l, 2, out bagItem);
            dataSectionBag.InitBagItem(bagItem);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_Bag(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag     dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            BagItemUpdateCache bag;
            LuaObject.checkType <BagItemUpdateCache>(l, 2, out bag);
            dataSectionBag.Bag = bag;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int FindBagItem(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(l);
            if (num == 2)
            {
                DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
                ulong          instanceId;
                LuaObject.checkType(l, 2, out instanceId);
                BagItemBase o = dataSectionBag.FindBagItem(instanceId);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, o);
                result = 2;
            }
            else if (num == 3)
            {
                DataSectionBag dataSectionBag2 = (DataSectionBag)LuaObject.checkSelf(l);
                GoodsType      goodsTypeId;
                LuaObject.checkEnum <GoodsType>(l, 2, out goodsTypeId);
                int contentId;
                LuaObject.checkType(l, 3, out contentId);
                BagItemBase o2 = dataSectionBag2.FindBagItem(goodsTypeId, contentId);
                LuaObject.pushValue(l, true);
                LuaObject.pushValue(l, o2);
                result = 2;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.lua_pushstring(l, "No matched override function FindBagItem to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int RemoveBagItem(IntPtr l)
    {
        int result;

        try
        {
            DataSectionBag dataSectionBag = (DataSectionBag)LuaObject.checkSelf(l);
            BagItemBase    bagItem;
            LuaObject.checkType <BagItemBase>(l, 2, out bagItem);
            int nums;
            LuaObject.checkType(l, 3, out nums);
            BagItemBase o = dataSectionBag.RemoveBagItem(bagItem, nums);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }