maxCost = $maxCost; } public function getValue() { return $this->value; } public function getCost() { return $this->cost; } public function getItems() : array { return $this->items; } public function addItem(Item $item) : void { $this->items[] = $item; $this->value += $item->getValue(); $this->cost += $item->getCost(); } }