Mooege.Core.GS.Common.InventoryGrid.FindSlotForItem C# (CSharp) 메소드

FindSlotForItem() 개인적인 메소드

Find an inventory slot with enough space for an item
private FindSlotForItem ( Item item ) : InventorySlot?
item Item
리턴 InventorySlot?
        private InventorySlot? FindSlotForItem(Item item)
        {
            InventorySize size = GetItemInventorySize(item);
            for (int r = 0; r <= Rows - size.Height; r++)
                for (int c = 0; c <= Columns - size.Width; c++)
                    if (CollectOverlappingItems(item, r, c) == 0)
                        return new InventorySlot() { Row = r, Column = c };
            return null;
        }