private void Rebuild(bool silent) { allItems = new IInventoryItem[_provider.inventoryItemCount]; for (var i = 0; i < _provider.inventoryItemCount; i++) { allItems[i] = _provider.GetInventoryItem(i); } if (!silent) { onRebuilt?.Invoke(); } }