Conditions | 4 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
32 | public function handle(DomainEvent $event): void |
||
33 | { |
||
34 | if ($event instanceof UnitMovedIntoPlay) { |
||
35 | $this->battlefield->add( |
||
36 | $this->cards->ofType($event->card()), |
||
37 | $event->aggregateId() |
||
38 | ); |
||
39 | } |
||
40 | if ($event instanceof UnitMovedToAttack) { |
||
41 | // @todo wont work with doubles.. |
||
42 | $this->cards->ofType($event->card())->attack(); |
||
43 | } |
||
44 | if ($event instanceof UnitDied) { |
||
45 | $this->battlefield->remove( |
||
46 | $this->cards->ofType($event->card()), |
||
47 | $event->match() |
||
48 | ); |
||
52 |