1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Stu\Orm\Entity; |
6
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping\Column; |
8
|
|
|
use Doctrine\ORM\Mapping\Entity; |
9
|
|
|
use Doctrine\ORM\Mapping\GeneratedValue; |
10
|
|
|
use Doctrine\ORM\Mapping\Id; |
11
|
|
|
use Doctrine\ORM\Mapping\JoinColumn; |
12
|
|
|
use Doctrine\ORM\Mapping\ManyToOne; |
13
|
|
|
use Doctrine\ORM\Mapping\Table; |
14
|
|
|
use Stu\Component\Map\MapEnum; |
|
|
|
|
15
|
|
|
use Stu\Orm\Repository\LayerRepository; |
16
|
|
|
|
17
|
|
|
#[Table(name: 'stu_layer')] |
18
|
|
|
#[Entity(repositoryClass: LayerRepository::class)] |
19
|
|
|
class Layer |
20
|
|
|
{ |
21
|
|
|
#[Id] |
22
|
|
|
#[Column(type: 'integer')] |
23
|
|
|
#[GeneratedValue(strategy: 'IDENTITY')] |
24
|
|
|
private int $id; |
25
|
|
|
|
26
|
|
|
#[Column(type: 'string')] |
27
|
|
|
private string $name; |
28
|
|
|
|
29
|
|
|
#[Column(type: 'integer')] |
30
|
|
|
private int $width; |
31
|
|
|
|
32
|
|
|
#[Column(type: 'integer')] |
33
|
|
|
private int $height; |
34
|
|
|
|
35
|
|
|
#[Column(type: 'boolean')] |
36
|
|
|
private bool $is_hidden; |
37
|
|
|
|
38
|
|
|
#[Column(type: 'boolean', nullable: true)] |
39
|
|
|
private ?bool $is_finished = null; |
40
|
|
|
|
41
|
|
|
#[Column(type: 'boolean', nullable: true)] |
42
|
|
|
private ?bool $is_encoded = null; |
43
|
|
|
|
44
|
|
|
#[Column(type: 'integer', nullable: true)] |
45
|
|
|
private ?int $award_id = null; |
|
|
|
|
46
|
|
|
|
47
|
|
|
#[Column(type: 'text', nullable: true)] |
48
|
|
|
private ?string $description = null; |
49
|
|
|
|
50
|
|
|
#[Column(type: 'boolean', nullable: true)] |
51
|
|
|
private ?bool $is_colonizable = null; |
52
|
|
|
|
53
|
|
|
#[Column(type: 'boolean', nullable: true)] |
54
|
|
|
private ?bool $is_noobzone = null; |
55
|
|
|
|
56
|
|
|
#[ManyToOne(targetEntity: Award::class)] |
57
|
|
|
#[JoinColumn(name: 'award_id', referencedColumnName: 'id')] |
58
|
|
|
private ?Award $award = null; |
59
|
|
|
|
60
|
|
|
|
61
|
26 |
|
public function getId(): int |
62
|
|
|
{ |
63
|
26 |
|
return $this->id; |
64
|
|
|
} |
65
|
|
|
|
66
|
9 |
|
public function getName(): string |
67
|
|
|
{ |
68
|
9 |
|
return $this->name; |
69
|
|
|
} |
70
|
|
|
|
71
|
13 |
|
public function getWidth(): int |
72
|
|
|
{ |
73
|
13 |
|
return $this->width; |
74
|
|
|
} |
75
|
|
|
|
76
|
13 |
|
public function getHeight(): int |
77
|
|
|
{ |
78
|
13 |
|
return $this->height; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function isHidden(): bool |
82
|
|
|
{ |
83
|
|
|
return $this->is_hidden; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function isFinished(): bool |
87
|
|
|
{ |
88
|
|
|
if ($this->is_finished === null) { |
89
|
|
|
return false; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
return $this->is_finished; |
93
|
|
|
} |
94
|
|
|
|
95
|
5 |
|
public function isEncoded(): bool |
96
|
|
|
{ |
97
|
5 |
|
if ($this->is_encoded === null) { |
98
|
|
|
return false; |
99
|
|
|
} |
100
|
|
|
|
101
|
5 |
|
return $this->is_encoded; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public function getAward(): ?Award |
105
|
|
|
{ |
106
|
|
|
return $this->award; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function getDescription(): ?string |
110
|
|
|
{ |
111
|
|
|
return $this->description; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function setDescription(?string $description): Layer |
115
|
|
|
{ |
116
|
|
|
$this->description = $description; |
117
|
|
|
|
118
|
|
|
return $this; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
public function isColonizable(): bool |
122
|
|
|
{ |
123
|
|
|
if ($this->is_colonizable === null) { |
124
|
|
|
return false; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
return $this->is_colonizable; |
128
|
|
|
} |
129
|
|
|
|
130
|
1 |
|
public function isNoobzone(): bool |
131
|
|
|
{ |
132
|
1 |
|
if ($this->is_noobzone === null) { |
133
|
1 |
|
return false; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
return $this->is_noobzone; |
137
|
|
|
} |
138
|
|
|
|
139
|
4 |
|
public function getSectorsHorizontal(): int |
140
|
|
|
{ |
141
|
4 |
|
return (int)ceil($this->getWidth() / MapEnum::FIELDS_PER_SECTION); |
142
|
|
|
} |
143
|
|
|
|
144
|
4 |
|
public function getSectorsVertical(): int |
145
|
|
|
{ |
146
|
4 |
|
return (int)ceil($this->getHeight() / MapEnum::FIELDS_PER_SECTION); |
147
|
|
|
} |
148
|
|
|
|
149
|
4 |
|
public function getSectorCount(): int |
150
|
|
|
{ |
151
|
4 |
|
return $this->getSectorsVertical() * $this->getSectorsHorizontal(); |
152
|
|
|
} |
153
|
|
|
|
154
|
1 |
|
public function getSectorId(int $mapCx, int $mapCy): int |
155
|
|
|
{ |
156
|
1 |
|
return $mapCx + ($mapCy - 1) * $this->getSectorsHorizontal(); |
157
|
|
|
} |
158
|
|
|
} |
159
|
|
|
|
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