| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ColonyDefendingBattleParty extends AbstractBattleParty implements AlertedBattlePartyInterface |
||
| 10 | { |
||
| 11 | 4 | public function __construct( |
|
| 15 | } |
||
| 16 | |||
| 17 | 2 | public function initMembers(): Collection |
|
| 18 | { |
||
| 19 | 2 | $fleet = $this->leader->getFleetWrapper(); |
|
| 20 | |||
| 21 | 2 | if ($fleet === null) { |
|
| 22 | 1 | return $this->createSingleton($this->leader); |
|
| 23 | } else { |
||
| 24 | |||
| 25 | // only uncloaked ships enter fight |
||
| 26 | 1 | return $fleet->getShipWrappers() |
|
| 27 | 1 | ->filter(fn (ShipWrapperInterface $wrapper) => !$wrapper->get()->getCloakState()); |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | public function getAttackCause(): ShipAttackCauseEnum |
|
| 32 | { |
||
| 33 | 1 | return ShipAttackCauseEnum::COLONY_DEFENSE; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function getAlertDescription(): string |
|
| 39 | } |
||
| 40 | } |
||
| 41 |