1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Stu\Lib\Interaction\Member; |
4
|
|
|
|
5
|
|
|
use Override; |
|
|
|
|
6
|
|
|
use Stu\Component\Spacecraft\Nbs\NbsUtilityInterface; |
7
|
|
|
use Stu\Lib\Interaction\InteractionCheckType; |
8
|
|
|
use Stu\Module\Ship\Lib\TholianWebUtilInterface; |
9
|
|
|
use Stu\Orm\Entity\MapInterface; |
10
|
|
|
use Stu\Orm\Entity\SpacecraftInterface; |
11
|
|
|
use Stu\Orm\Entity\StarSystemMapInterface; |
12
|
|
|
use Stu\Orm\Entity\UserInterface; |
13
|
|
|
|
14
|
|
|
class SpacecraftMember implements InteractionMemberInterface |
15
|
|
|
{ |
16
|
15 |
|
public function __construct( |
17
|
|
|
private NbsUtilityInterface $nbsUtility, |
18
|
|
|
private TholianWebUtilInterface $tholianWebUtil, |
19
|
|
|
private SpacecraftInterface $spacecraft |
20
|
15 |
|
) {} |
21
|
|
|
|
22
|
|
|
#[Override] |
23
|
|
|
public function get(): SpacecraftInterface |
24
|
|
|
{ |
25
|
|
|
return $this->spacecraft; |
26
|
|
|
} |
27
|
|
|
|
28
|
13 |
|
#[Override] |
29
|
|
|
public function canAccess( |
30
|
|
|
InteractionMemberInterface $other, |
31
|
|
|
callable $shouldCheck |
32
|
|
|
): ?InteractionCheckType { |
33
|
|
|
|
34
|
|
|
if ( |
35
|
13 |
|
$shouldCheck(InteractionCheckType::EXPECT_SOURCE_UNSHIELDED) |
36
|
13 |
|
&& $this->spacecraft->getShieldState() |
37
|
|
|
) { |
38
|
|
|
return InteractionCheckType::EXPECT_SOURCE_UNSHIELDED; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
if ( |
42
|
13 |
|
$shouldCheck(InteractionCheckType::EXPECT_SOURCE_UNCLOAKED) |
43
|
13 |
|
&& $this->spacecraft->getCloakState() |
44
|
|
|
) { |
45
|
|
|
return InteractionCheckType::EXPECT_SOURCE_UNCLOAKED; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
if ( |
49
|
13 |
|
$shouldCheck(InteractionCheckType::EXPECT_SOURCE_TACHYON) |
50
|
13 |
|
&& $other instanceof SpacecraftMember |
51
|
13 |
|
&& $other->get()->getCloakState() |
52
|
13 |
|
&& !$this->nbsUtility->isTachyonActive($this->spacecraft) |
53
|
|
|
) { |
54
|
|
|
return InteractionCheckType::EXPECT_SOURCE_TACHYON; |
55
|
|
|
} |
56
|
|
|
|
57
|
13 |
|
return null; |
58
|
|
|
} |
59
|
|
|
|
60
|
12 |
|
#[Override] |
61
|
|
|
public function canBeAccessedFrom( |
62
|
|
|
InteractionMemberInterface $other, |
63
|
|
|
bool $isFriend, |
64
|
|
|
callable $shouldCheck |
65
|
|
|
): ?InteractionCheckType { |
66
|
|
|
|
67
|
|
|
if ( |
68
|
12 |
|
$shouldCheck(InteractionCheckType::EXPECT_TARGET_UNSHIELDED) |
69
|
12 |
|
&& $this->spacecraft->getShieldState() && !$isFriend |
70
|
|
|
) { |
71
|
|
|
return InteractionCheckType::EXPECT_TARGET_UNSHIELDED; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
if ( |
75
|
12 |
|
$shouldCheck(InteractionCheckType::EXPECT_TARGET_UNCLOAKED) |
76
|
12 |
|
&& $this->spacecraft->getCloakState() |
77
|
|
|
) { |
78
|
|
|
return InteractionCheckType::EXPECT_TARGET_UNCLOAKED; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
if ( |
82
|
12 |
|
$shouldCheck(InteractionCheckType::EXPECT_TARGET_ALSO_IN_FINISHED_WEB) |
83
|
12 |
|
&& $this->tholianWebUtil->isTargetOutsideFinishedTholianWeb($other->get(), $this->spacecraft) |
84
|
|
|
) { |
85
|
|
|
return InteractionCheckType::EXPECT_TARGET_ALSO_IN_FINISHED_WEB; |
86
|
|
|
} |
87
|
|
|
|
88
|
12 |
|
return null; |
89
|
|
|
} |
90
|
|
|
|
91
|
15 |
|
#[Override] |
92
|
|
|
public function getLocation(): MapInterface|StarSystemMapInterface |
93
|
|
|
{ |
94
|
15 |
|
return $this->spacecraft->getLocation(); |
95
|
|
|
} |
96
|
|
|
|
97
|
15 |
|
#[Override] |
98
|
|
|
public function getUser(): ?UserInterface |
99
|
|
|
{ |
100
|
15 |
|
return $this->spacecraft->getUser(); |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
|
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