for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Stu\Module\Ship\Lib\Battle\Party;
use Doctrine\Common\Collections\Collection;
use Stu\Module\Ship\Lib\Battle\ShipAttackCauseEnum;
use Stu\Module\Ship\Lib\ShipWrapperInterface;
class ColonyDefendingBattleParty extends AbstractBattleParty implements AlertedBattlePartyInterface
{
public function __construct(
ShipWrapperInterface $leader
) {
parent::__construct($leader);
}
public function initMembers(): Collection
$fleet = $this->leader->getFleetWrapper();
if ($fleet === null) {
return $this->createSingleton($this->leader);
} else {
// only uncloaked ships enter fight
return $fleet->getShipWrappers()
->filter(fn (ShipWrapperInterface $wrapper) => !$wrapper->get()->getCloakState());
public function getAttackCause(): ShipAttackCauseEnum
return ShipAttackCauseEnum::COLONY_DEFENSE;
public function getAlertDescription(): string
return '[b][color=orange]Kolonie-Verteidigung[/color][/b]';