Esempio n. 1
0
 /**
  * Creates a new instance of a TF2Item with the given data
  *
  * @param TF2Inventory $inventory The inventory this item is contained in
  * @param \stdClass $itemData The data specifying this item
  * @throws \SteamCondenser\Exceptions\WebApiException on Web API errors
  */
 public function __construct(TF2Inventory $inventory, $itemData)
 {
     parent::__construct($inventory, $itemData);
     $this->equipped = [];
     foreach (self::$CLASSES as $classId => $className) {
         $this->equipped[$className] = $itemData->inventory & 1 << 16 + $classId != 0;
     }
 }
 /**
  * Creates a new instance of a Portal2Item with the given data
  *
  * @param Portal2Inventory $inventory The inventory this item is contained
  *        in
  * @param \stdClass $itemData The data specifying this item
  * @throws \SteamCondenser\Exceptions\WebApiException on Web API errors
  */
 public function __construct(Portal2Inventory $inventory, $itemData)
 {
     parent::__construct($inventory, $itemData);
     $this->equipped = [];
     foreach (self::$BOTS as $botId => $botName) {
         $this->equipped[self::$BOTS[$botId]] = ($itemData->inventory & 1 << 16 + $botId) != 0;
     }
 }
Esempio n. 3
0
 /**
  * Creates a new instance of a Portal2Item with the given data
  *
  * @param Portal2Inventory $inventory The inventory this item is contained
  *        in
  * @param \stdClass $itemData The data specifying this item
  * @throws \SteamCondenser\Exceptions\WebApiException on Web API errors
  */
 public function __construct(Portal2Inventory $inventory, $itemData)
 {
     parent::__construct($inventory, $itemData);
     $this->equipped = [];
     for ($botId = 0; $botId < sizeof(self::$BOTS); $botId++) {
         $this->equipped[self::$BOTS[$botId]] = ($itemData->inventory & 1 << 16 + $botId) != 0;
     }
 }
 /**
  * Creates a new instance of a DotA2Item with the given data
  *
  * @param DotA2Inventory $inventory The inventory this item is contained
  *        in
  * @param \stdClass $itemData The data specifying this item
  * @throws \SteamCondenser\Exceptions\WebApiException on Web API errors
  */
 public function __construct(DotA2Inventory $inventory, $itemData)
 {
     parent::__construct($inventory, $itemData);
     $this->equipped = property_exists($itemData, 'equipped') && sizeof($itemData->equipped) > 0;
 }