| Total Complexity | 11 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | trait SpacecraftSystemExistenceTrait |
||
| 8 | { |
||
| 9 | use SpacecraftTrait; |
||
| 10 | |||
| 11 | 38 | public function hasSpacecraftSystem(SpacecraftSystemTypeEnum $type): bool |
|
| 12 | { |
||
| 13 | 38 | return $this->getThis()->getSystems()->containsKey($type->value); |
|
| 14 | } |
||
| 15 | |||
| 16 | 4 | public function hasPhaser(): bool |
|
| 17 | { |
||
| 18 | 4 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::PHASER); |
|
| 19 | } |
||
| 20 | |||
| 21 | 6 | public function hasTorpedo(): bool |
|
| 22 | { |
||
| 23 | 6 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::TORPEDO); |
|
| 24 | } |
||
| 25 | |||
| 26 | 4 | public function hasCloak(): bool |
|
| 27 | { |
||
| 28 | 4 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::CLOAK); |
|
| 29 | } |
||
| 30 | |||
| 31 | 4 | public function hasShuttleRamp(): bool |
|
| 32 | { |
||
| 33 | 4 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::SHUTTLE_RAMP); |
|
| 34 | } |
||
| 35 | |||
| 36 | 6 | public function hasWarpdrive(): bool |
|
| 37 | { |
||
| 38 | 6 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::WARPDRIVE); |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | public function hasReactor(): bool |
|
| 42 | { |
||
| 43 | 1 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::WARPCORE) || |
|
| 44 | 1 | $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::FUSION_REACTOR) || |
|
| 45 | 1 | $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::SINGULARITY_REACTOR); |
|
| 46 | } |
||
| 47 | |||
| 48 | 2 | public function hasNbsLss(): bool |
|
| 49 | { |
||
| 50 | 2 | return $this->hasSpacecraftSystem(SpacecraftSystemTypeEnum::LSS); |
|
| 51 | } |
||
| 52 | |||
| 53 | 7 | public function hasUplink(): bool |
|
| 56 | } |
||
| 57 | } |
||
| 58 |