/**
* @param InventoryHolder $holder
* @param InventoryType $type
* @param Item[] $items
* @param int $overrideSize
* @param string $overrideTitle
*/
public function __construct(InventoryHolder $holder, InventoryType $type, array $items = [], $overrideSize = \null, $overrideTitle = \null)
{
$this->holder = $holder;
$this->type = $type;
if ($overrideSize !== \null) {
$this->size = (int) $overrideSize;
} else {
$this->size = $this->type->getDefaultSize();
}
if ($overrideTitle !== \null) {
$this->title = $overrideTitle;
} else {
$this->title = $this->type->getDefaultTitle();
}
$this->name = $this->type->getDefaultTitle();
$this->setContents($items);
}