Conditions | 6 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 10.5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 3 | public function hasEnoughCrew(?GameControllerInterface $game = null): bool |
|
34 | { |
||
35 | 3 | $buildplan = $this->getThis()->getBuildplan(); |
|
36 | |||
37 | 3 | if ($buildplan === null) { |
|
38 | if ($game !== null) { |
||
39 | $game->addInformation(_("Keine Crew vorhanden")); |
||
40 | } |
||
41 | return false; |
||
42 | } |
||
43 | |||
44 | 3 | $result = $buildplan->getCrew() <= 0 |
|
45 | 3 | || $this->getCrewCount() >= $buildplan->getCrew(); |
|
46 | |||
47 | 3 | if (!$result && $game !== null) { |
|
48 | $game->addInformationf( |
||
49 | _("Es werden %d Crewmitglieder benötigt"), |
||
50 | $buildplan->getCrew() |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | 3 | return $result; |
|
55 | } |
||
66 |