/** * Constructor * Hero is abstract, but the extended classes should in constructors pass in options for hero power etc * * @param array $options Options to set during initialization */ public function __construct(array $options = []) { // Set hero power reference if (isset($options['heroPower']) && $options['heroPower'] instanceof HeroPower) { $this->heroPower = $options['heroPower']; } // Call the parent constructor to set up events, etc. parent::__construct($options); }
/** * {@inheritDoc} * * @param array $options Options to set during initialization * */ public function __construct($options = []) { $options['deathrattle'] = [new ZombieChowDeathrattle()]; parent::__construct($options); }