mirror of
https://github.com/openlegends/asset-php.git
synced 2025-02-08 13:04:22 +00:00
init multiple ability
This commit is contained in:
parent
a0b8d73d19
commit
e652ac6ca0
17
src/Test/Ability/Multiple.php
Normal file
17
src/Test/Ability/Multiple.php
Normal file
@ -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;
|
||||
}
|
||||
}
|
@ -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…
x
Reference in New Issue
Block a user