/** * Creates a new instance of L4D2Weapon based on the assigned XML data * @param $weaponData */ public function __construct($weaponData) { parent::__construct($weaponData); $this->damage = (int) $weaponData->damage; $this->killPercentage = (string) $weaponData->pctkills; $this->weaponGroup = $weaponGroup['group']; }
/** * Creates a new instance of a weapon based on the given XML data * * @param \SimpleXMLElement $weaponData The XML data of this weapon */ public function __construct(\SimpleXMLElement $weaponData) { parent::__construct($weaponData); $this->damage = (int) $weaponData->damage; $this->killPercentage = (double) $weaponData->pctkills * 0.01; $this->weaponGroup = $weaponData['group']; }
/** * Creates a new instance of a weapon based on the given XML data * * @param \SimpleXMLElement $weaponData The XML data for this weapon */ public function __construct(\SimpleXMLElement $weaponData) { parent::__construct($weaponData); $this->killPercentage = (double) $weaponData->killpct * 0.01; }
/** * Creates a new instance of L4DWeapon based on the assigned XML data * @param $weaponData */ public function __construct($weaponData) { parent::__construct($weaponData); $this->killPercentage = (string) $weaponData->killpct; }