for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Stu\Module\Ship\Lib\Movement\Component\PreFlight\Condition;
use Stu\Component\Ship\System\ShipSystemTypeEnum;
use Stu\Module\Ship\Lib\ActivatorDeactivatorHelperInterface;
use Stu\Module\Ship\Lib\Movement\Component\PreFlight\ConditionCheckResult;
use Stu\Module\Ship\Lib\Movement\Route\FlightRouteInterface;
use Stu\Module\Ship\Lib\ShipWrapperInterface;
class DriveActivatableCondition implements PreFlightConditionInterface
{
private ActivatorDeactivatorHelperInterface $activatorDeactivatorHelper;
public function __construct(ActivatorDeactivatorHelperInterface $activatorDeactivatorHelper)
$this->activatorDeactivatorHelper = $activatorDeactivatorHelper;
}
public function check(
ShipWrapperInterface $wrapper,
FlightRouteInterface $flightRoute,
ConditionCheckResult $conditionCheckResult
): void {
if ($flightRoute->isImpulseDriveNeeded()) {
$this->activatorDeactivatorHelper->activate(
$wrapper,
ShipSystemTypeEnum::SYSTEM_IMPULSEDRIVE,
$conditionCheckResult,
false,
true
);
if ($flightRoute->isWarpDriveNeeded()) {
ShipSystemTypeEnum::SYSTEM_WARPDRIVE,
if ($flightRoute->isTranswarpCoilNeeded()) {
ShipSystemTypeEnum::SYSTEM_TRANSWARP_COIL,