|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Spacecraft\Lib\Movement\Route; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use Stu\Component\Map\Effects\EffectHandlingInterface; |
|
9
|
|
|
use Stu\Module\Spacecraft\Lib\Movement\Component\Consequence\FlightConsequenceInterface; |
|
10
|
|
|
use Stu\Orm\Entity\MapInterface; |
|
11
|
|
|
use Stu\Orm\Entity\SpacecraftInterface; |
|
12
|
|
|
use Stu\Orm\Entity\StarSystemMapInterface; |
|
13
|
|
|
use Stu\Orm\Entity\WormholeEntryInterface; |
|
14
|
|
|
|
|
15
|
|
|
final class FlightRouteFactory implements FlightRouteFactoryInterface |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* @param array<string, FlightConsequenceInterface> $flightConsequences |
|
19
|
|
|
* @param array<string, FlightConsequenceInterface> $postFlightConsequences |
|
20
|
|
|
*/ |
|
21
|
1 |
|
public function __construct( |
|
22
|
|
|
private CheckDestinationInterface $checkDestination, |
|
23
|
|
|
private LoadWaypointsInterface $loadWaypoints, |
|
24
|
|
|
private EnterWaypoint $enterWaypoint, |
|
25
|
|
|
private EffectHandlingInterface $effectHandling, |
|
26
|
|
|
private array $flightConsequences, |
|
27
|
|
|
private array $postFlightConsequences |
|
28
|
1 |
|
) {} |
|
29
|
|
|
|
|
30
|
|
|
#[Override] |
|
31
|
|
|
public function getRouteForMapDestination( |
|
32
|
|
|
MapInterface|StarSystemMapInterface $destination, |
|
33
|
|
|
bool $isTranswarp = false |
|
34
|
|
|
): FlightRouteInterface { |
|
35
|
|
|
return $this->getFlightRoutePrototype()->setDestination($destination, $isTranswarp); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
#[Override] |
|
39
|
|
|
public function getRouteForWormholeDestination(WormholeEntryInterface $destination, bool $isEntry): FlightRouteInterface |
|
40
|
|
|
{ |
|
41
|
|
|
return $this->getFlightRoutePrototype()->setDestinationViaWormhole($destination, $isEntry); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
#[Override] |
|
45
|
|
|
public function getRouteForCoordinateDestination(SpacecraftInterface $spacecraft, int $x, int $y): FlightRouteInterface |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->getFlightRoutePrototype()->setDestinationViaCoordinates($spacecraft, $x, $y); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
private function getFlightRoutePrototype(): FlightRoute |
|
51
|
|
|
{ |
|
52
|
|
|
return new FlightRoute( |
|
53
|
|
|
$this->checkDestination, |
|
54
|
|
|
$this->loadWaypoints, |
|
55
|
|
|
$this->enterWaypoint, |
|
56
|
|
|
$this->effectHandling, |
|
57
|
|
|
$this->flightConsequences, |
|
58
|
|
|
$this->postFlightConsequences |
|
59
|
|
|
); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths