reimplemented getNumberOfType in inventoryManager