Browse Source

init multiple ability

main
openlegends 9 months ago
parent
commit
e652ac6ca0
  1. 17
      src/Test/Ability/Multiple.php
  2. 10
      src/Test/Card/Goblin.php

17
src/Test/Ability/Multiple.php

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace OpenLegends\Asset\Test\Ability;
class Multiple extends \OpenLegends\Engine\Abstract\Ability
{
private array $_abilities = [];
public function add(
\OpenLegends\Engine\Abstract\Ability $ability
): void
{
$this->_abilities[] = $ability;
}
}

10
src/Test/Card/Goblin.php

@ -8,14 +8,20 @@ class Goblin extends \OpenLegends\Engine\Abstract\Card @@ -8,14 +8,20 @@ class Goblin extends \OpenLegends\Engine\Abstract\Card
{
public function __construct()
{
$this->setAbility(
$ability = new \OpenLegends\Asset\Test\Ability\Multiple();
$ability->add(
new \OpenLegends\Asset\Test\Ability\Lethal()
);
$this->addAbility(
$ability->add(
new \OpenLegends\Asset\Test\Ability\Guard()
);
$this->setAbility(
$ability
);
$this->setAttribute(
new \OpenLegends\Asset\Test\Attribute\Neutral()
);

Loading…
Cancel
Save