예제 #1
0
        public bool TryAdd(IEntityContainer holder, Entity item)
        {
            if (item == null || holder == null || holder.IsFull || holder.Contains(item))
            {
                return(false);
            }
            var inventoryItem = item.Get <InventoryItem>();

            if (inventoryItem == null)
            {
                return(false);
            }
            if (inventoryItem.Inventory != null)
            {
                inventoryItem.Inventory.Remove(item);
            }
            ProcessHolderChange(holder, item, inventoryItem, holder.ContainerSystemAdd(item));
            return(true);
        }