Пример #1
0
    internal bool StockShelf(Collider2D shelf)
    {
        Shelf shelfInfo = shelf.GetComponent <Shelf>();

        for (int i = 0; i < _inventory.Count; i++)
        {
            if (shelfInfo.CompareGenres(_inventory[i].genre) && _inventory[i].rewound && !shelfInfo.IsFull()) // if the tapes are the same genre, rewound, and we have room
            {
                Debug.Log("Tape Returned");

                shelfInfo.IncrementStock(); // stock shelf

                RemoveTapeFromInventory(i);

                return(true); // exit
            }
        }
        return(false);
    }