| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class WarpCoreSystemData extends AbstractSystemData |
||
| 11 | { |
||
| 12 | // warpdrive fields |
||
| 13 | public int $split = 100; |
||
| 14 | |||
| 15 | private ShipSystemRepositoryInterface $shipSystemRepository; |
||
| 16 | |||
| 17 | public function __construct(ShipSystemRepositoryInterface $shipSystemRepository) |
||
| 20 | } |
||
| 21 | |||
| 22 | public function update(): void |
||
| 23 | { |
||
| 24 | // Überprüfe und begrenze den Wert zwischen 0 und 100 |
||
| 25 | $this->split = max(0, min(100, $this->split)); |
||
| 26 | |||
| 27 | $this->updateSystemData( |
||
| 28 | ShipSystemTypeEnum::SYSTEM_WARPCORE, |
||
| 29 | $this, |
||
| 30 | $this->shipSystemRepository |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getWarpCoreSplit(): int |
||
| 35 | { |
||
| 36 | return $this->split; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function setWarpCoreSplit(int $split): WarpCoreSystemData |
||
| 43 | } |
||
| 44 | } |