/** * Constructor * HeroPower is abstract, but the extended classes hold information about triggers and functionality * * @param array $options Options to set during initialization */ public function __construct(array $options = []) { // Listen to board start $options['listeners'] = [EntityEvent::EVENT_BOARD_TURN_START]; // Call the parent constructor to set up events, etc. parent::__construct($options); }
/** * Constructor * Allow to set some options like adjustments on initialization * * @param array $options Options to set during initialization */ public function __construct(array $options = []) { // Add deathrattle effects if (isset($options['deathrattle'])) { foreach ($options['deathrattle'] as $deathrattle) { if ($deathrattle instanceof Deathrattle) { $this->deathrattle[] = $deathrattle; } } } // Pass to Entity::__construct parent::__construct($options); }