public function __construct(InventoryBucket $bucket, array $properties)
{
$hash = (string) $properties['itemHash'];
$stats = array_get($properties, 'stats') ?: [];
$definition = manifest()->inventoryItem($hash);
$properties = array_merge($properties, $definition->getProperties());
$properties['isClassified'] = $hash && empty($properties['itemName']);
if ($properties['isClassified'] && isset($this->classified[$hash])) {
$properties = array_merge($this->classified[$hash], $properties);
}
parent::__construct($properties);
$this->bucket = $bucket;
$this->stats = new StatCollection($stats);
/*
$itemHash = (string) $properties['
}itemHash'];
if (array_key_exists($itemHash, $this->patchDefinitions))
{
$definition = json_decode($this->patchDefinitions[$itemHash], true);
}
else
{
$definition = array_get($definitions, "items.$itemHash", []);
}
if (isset($properties['progression']))
{
if ( ! $properties['progression']['progressToNextLevel'] && $properties['progression']['currentProgress'] > 0)
{
$properties['progression']['progressToNextLevel'] = $properties['progression']['nextLevelAt'];
}
}
*/
}