1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Stu\Orm\Entity; |
6
|
|
|
|
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
8
|
|
|
use Doctrine\Common\Collections\Collection; |
9
|
|
|
use Doctrine\ORM\Mapping\Column; |
10
|
|
|
use Doctrine\ORM\Mapping\Entity; |
11
|
|
|
use Doctrine\ORM\Mapping\GeneratedValue; |
12
|
|
|
use Doctrine\ORM\Mapping\Id; |
13
|
|
|
use Doctrine\ORM\Mapping\JoinColumn; |
14
|
|
|
use Doctrine\ORM\Mapping\OneToMany; |
15
|
|
|
use Doctrine\ORM\Mapping\OneToOne; |
16
|
|
|
use Doctrine\ORM\Mapping\Table; |
17
|
|
|
use Override; |
|
|
|
|
18
|
|
|
use Stu\Component\Colony\ColonyEnum; |
|
|
|
|
19
|
|
|
use Stu\Component\Colony\ColonyTypeEnum; |
|
|
|
|
20
|
|
|
use Stu\Orm\Repository\ColonyClassRepository; |
21
|
|
|
|
22
|
|
|
#[Table(name: 'stu_colonies_classes')] |
23
|
|
|
#[Entity(repositoryClass: ColonyClassRepository::class)] |
24
|
|
|
class ColonyClass implements ColonyClassInterface |
25
|
|
|
{ |
26
|
|
|
#[Id] |
27
|
|
|
#[Column(type: 'integer')] |
28
|
|
|
#[GeneratedValue(strategy: 'IDENTITY')] |
29
|
|
|
private int $id; |
30
|
|
|
|
31
|
|
|
#[Column(type: 'string')] |
32
|
|
|
private string $name = ''; |
33
|
|
|
|
34
|
|
|
#[Column(type: 'integer')] |
35
|
|
|
private int $type; |
36
|
|
|
|
37
|
|
|
#[Column(type: 'integer', nullable: true)] |
38
|
|
|
private ?int $database_id = null; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var array<int> |
42
|
|
|
*/ |
43
|
|
|
#[Column(type: 'json')] |
44
|
|
|
private array $colonizeable_fields = []; |
45
|
|
|
|
46
|
|
|
#[Column(type: 'smallint')] |
47
|
|
|
private int $bev_growth_rate = 0; |
48
|
|
|
|
49
|
|
|
#[Column(type: 'smallint')] |
50
|
|
|
private int $special = 0; |
51
|
|
|
|
52
|
|
|
#[Column(type: 'boolean')] |
53
|
|
|
private bool $allow_start = false; |
54
|
|
|
|
55
|
|
|
#[Column(type: 'integer')] |
56
|
|
|
private int $min_rot = 1; |
57
|
|
|
|
58
|
|
|
#[Column(type: 'integer')] |
59
|
|
|
private int $max_rot = 1; |
60
|
|
|
|
61
|
|
|
#[OneToOne(targetEntity: 'DatabaseEntry')] |
62
|
|
|
#[JoinColumn(name: 'database_id', referencedColumnName: 'id')] |
63
|
|
|
private ?DatabaseEntryInterface $databaseEntry; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var ArrayCollection<int, ColonyClassDepositInterface> |
67
|
|
|
*/ |
68
|
|
|
#[OneToMany(targetEntity: 'ColonyClassDeposit', mappedBy: 'colonyClass', indexBy: 'commodity_id')] |
69
|
|
|
private Collection $colonyClassDeposits; |
70
|
|
|
|
71
|
|
|
public function __construct() |
72
|
|
|
{ |
73
|
|
|
$this->colonyClassDeposits = new ArrayCollection(); |
74
|
|
|
} |
75
|
|
|
|
76
|
14 |
|
#[Override] |
77
|
|
|
public function getId(): int |
78
|
|
|
{ |
79
|
14 |
|
return $this->id; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
#[Override] |
83
|
|
|
public function getName(): string |
84
|
|
|
{ |
85
|
|
|
return $this->name; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
#[Override] |
89
|
|
|
public function setName(string $name): ColonyClassInterface |
90
|
|
|
{ |
91
|
|
|
$this->name = $name; |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
3 |
|
#[Override] |
97
|
|
|
public function getType(): int |
98
|
|
|
{ |
99
|
3 |
|
return $this->type; |
100
|
|
|
} |
101
|
|
|
|
102
|
3 |
|
#[Override] |
103
|
|
|
public function isPlanet(): bool |
104
|
|
|
{ |
105
|
3 |
|
return $this->getType() === ColonyTypeEnum::COLONY_TYPE_PLANET; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
#[Override] |
109
|
|
|
public function isMoon(): bool |
110
|
|
|
{ |
111
|
|
|
return $this->getType() === ColonyTypeEnum::COLONY_TYPE_MOON; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
#[Override] |
115
|
|
|
public function isAsteroid(): bool |
116
|
|
|
{ |
117
|
|
|
return $this->getType() === ColonyTypeEnum::COLONY_TYPE_ASTEROID; |
118
|
|
|
} |
119
|
|
|
|
120
|
1 |
|
#[Override] |
121
|
|
|
public function getDatabaseId(): ?int |
122
|
|
|
{ |
123
|
1 |
|
return $this->database_id; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
#[Override] |
127
|
|
|
public function setDatabaseEntry(?DatabaseEntryInterface $entry): ColonyClassInterface |
128
|
|
|
{ |
129
|
|
|
$this->databaseEntry = $entry; |
130
|
|
|
|
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
#[Override] |
135
|
|
|
public function getColonizeableFields(): array |
136
|
|
|
{ |
137
|
|
|
return $this->colonizeable_fields; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
#[Override] |
141
|
|
|
public function setColonizeableFields(array $colonizeableFields): ColonyClassInterface |
142
|
|
|
{ |
143
|
|
|
$this->colonizeable_fields = $colonizeableFields; |
144
|
|
|
|
145
|
|
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
4 |
|
#[Override] |
149
|
|
|
public function getBevGrowthRate(): int |
150
|
|
|
{ |
151
|
4 |
|
return $this->bev_growth_rate; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
#[Override] |
155
|
|
|
public function setBevGrowthRate(int $bevGroethRate): ColonyClassInterface |
156
|
|
|
{ |
157
|
|
|
$this->bev_growth_rate = $bevGroethRate; |
158
|
|
|
|
159
|
|
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
2 |
|
#[Override] |
163
|
|
|
public function getSpecialId(): int |
164
|
|
|
{ |
165
|
2 |
|
return $this->special; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
#[Override] |
169
|
|
|
public function setSpecialId(int $specialId): ColonyClassInterface |
170
|
|
|
{ |
171
|
|
|
$this->special = $specialId; |
172
|
|
|
|
173
|
|
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
#[Override] |
177
|
|
|
public function getAllowStart(): bool |
178
|
|
|
{ |
179
|
|
|
return $this->allow_start; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
#[Override] |
183
|
|
|
public function setAllowStart(bool $allowStart): ColonyClassInterface |
184
|
|
|
{ |
185
|
|
|
$this->allow_start = $allowStart; |
186
|
|
|
|
187
|
|
|
return $this; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
#[Override] |
191
|
|
|
public function getColonyClassDeposits(): Collection |
192
|
|
|
{ |
193
|
|
|
return $this->colonyClassDeposits; |
194
|
|
|
} |
195
|
|
|
|
196
|
2 |
|
#[Override] |
197
|
|
|
public function hasRing(): bool |
198
|
|
|
{ |
199
|
2 |
|
return $this->getSpecialId() == ColonyEnum::COLONY_CLASS_SPECIAL_RING; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
#[Override] |
203
|
|
|
public function getMinRotation(): int |
204
|
|
|
{ |
205
|
|
|
return $this->min_rot; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
#[Override] |
209
|
|
|
public function setMinRotation(int $rotation): ColonyClassInterface |
210
|
|
|
{ |
211
|
|
|
$this->min_rot = $rotation; |
212
|
|
|
|
213
|
|
|
return $this; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
#[Override] |
217
|
|
|
public function getMaxRotation(): int |
218
|
|
|
{ |
219
|
|
|
return $this->max_rot; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
#[Override] |
223
|
|
|
public function setMaxRotation(int $rotation): ColonyClassInterface |
224
|
|
|
{ |
225
|
|
|
$this->max_rot = $rotation; |
226
|
|
|
|
227
|
|
|
return $this; |
228
|
|
|
} |
229
|
|
|
} |
230
|
|
|
|
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