Inheritance: extends Definition
Ejemplo n.º 1
0
 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'];
     	}
     }
     */
 }
Ejemplo n.º 2
0
 public function __construct(ActivityLevel $level, array $properties)
 {
     parent::__construct($properties);
     $this->extend(manifest()->inventoryItem($this->itemHash));
     $this->activityLevel = $level;
 }
Ejemplo n.º 3
0
 public function __construct(array $properties)
 {
     $definition = manifest()->inventoryItem($properties['itemHash']);
     $properties = array_merge($definition->getProperties(), $properties);
     parent::__construct($properties);
 }