public override void OnDrop(UIBase ui)
 {
     if (ui is UIItemStack)
     {
         ItemStack = ui as UIItemStack;
     }
 }
Exemple #2
0
        public bool AddItemStack(UIItemStack itemStack)
        {
            var cell = GetNotFullCellByInfoItem(itemStack.InfoItem);

            if (cell != null)
            {
                cell.ItemStack = itemStack;
                return(true);
            }
            else
            {
                foreach (var c in cells)
                {
                    if (c.ItemStack == null)
                    {
                        c.ItemStack = itemStack;
                        return(true);
                    }
                }
            }

            return(false);
        }