Example #1
0
 public override void OnDrop(UIBase ui)
 {
     if (ui is UIItemStack)
     {
         ItemStack = ui as UIItemStack;
     }
 }
Example #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);
        }