Total Complexity | 5 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 77.78% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class SystemCellData extends CellData |
||
8 | { |
||
9 | public const ONLY_BACKGROUND_IMAGE = 1; |
||
10 | |||
11 | private int $x; |
||
12 | private int $y; |
||
13 | private int $systemFieldId; |
||
14 | private bool $colonyShieldState; |
||
15 | |||
16 | 4 | public function __construct( |
|
17 | int $x, |
||
18 | int $y, |
||
19 | int $systemFieldId, |
||
20 | bool $colonyShieldState, |
||
21 | ?string $subspaceCode, |
||
22 | ?string $displayCount |
||
23 | ) { |
||
24 | 4 | parent::__construct($subspaceCode, $displayCount); |
|
25 | |||
26 | 4 | $this->x = $x; |
|
27 | 4 | $this->y = $y; |
|
28 | 4 | $this->systemFieldId = $systemFieldId; |
|
29 | 4 | $this->colonyShieldState = $colonyShieldState; |
|
30 | } |
||
31 | |||
32 | 4 | public function getSystemBackgroundId(): string |
|
33 | { |
||
34 | 4 | return sprintf( |
|
35 | 4 | '%02d%02d', |
|
36 | 4 | $this->y, |
|
37 | 4 | $this->x |
|
38 | 4 | ); |
|
39 | } |
||
40 | |||
41 | public function getSystemFieldId(): ?int |
||
42 | { |
||
43 | if ($this->systemFieldId === self::ONLY_BACKGROUND_IMAGE) { |
||
44 | return null; |
||
45 | } |
||
46 | |||
47 | return $this->systemFieldId; |
||
48 | } |
||
49 | |||
50 | 4 | public function getColonyShieldState(): bool |
|
53 | } |
||
54 | } |
||
55 |