예제 #1
0
    public void Reflash()
    {
        if (mItemDrop == null)
        {
            return;
        }

        //Clear();

        int i = 0;

        for (; i < mItemDrop.GetCount(); i++)
        {
            if (mItemList.Count <= i)
            {
                AddItem(mItemDrop.Get(i));
                mGrid.repositionNow = true;
            }
            else
            {
                SetItem(i, mItemDrop.Get(i));
            }
        }

        for (int j = i; j < mItemList.Count;)
        {
            RemoveItem(mItemList[j]);
        }

        if (mItemList.Count == 0)
        {
            Hide();
        }
    }
예제 #2
0
    protected bool CanFetch(int index)
    {
        IItemDrop itemDrop = this as IItemDrop;

        if (index < 0 || index >= itemDrop.GetCount())
        {
            return(false);
        }
        return(playerPkg.package.CanAdd(itemDrop.Get(index)));
    }