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
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @Entity(repositoryClass="Stu\Orm\Repository\FactionRepository") |
17
|
|
|
* @Table( |
18
|
|
|
* name="stu_factions" |
19
|
|
|
* ) |
20
|
|
|
*/ |
21
|
|
|
class Faction implements FactionInterface |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @Id |
25
|
|
|
* @Column(type="integer") |
26
|
|
|
* @GeneratedValue(strategy="IDENTITY") |
27
|
|
|
* |
28
|
|
|
*/ |
29
|
|
|
private int $id; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @Column(type="string") |
33
|
|
|
*/ |
34
|
|
|
private string $name = ''; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @Column(type="text") |
38
|
|
|
*/ |
39
|
|
|
private string $description = ''; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @Column(type="string") |
43
|
|
|
*/ |
44
|
|
|
private string $darker_color = ''; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @Column(type="boolean") |
48
|
|
|
*/ |
49
|
|
|
private bool $chooseable = false; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @Column(type="integer") |
53
|
|
|
*/ |
54
|
|
|
private int $player_limit = 0; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @Column(type="integer") |
58
|
|
|
*/ |
59
|
|
|
private int $start_building_id = 0; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @Column(type="integer", nullable=true) |
63
|
|
|
*/ |
64
|
|
|
private ?int $start_research_id = null; |
|
|
|
|
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @Column(type="integer", nullable=true) |
68
|
|
|
*/ |
69
|
|
|
private ?int $start_map_id = null; |
|
|
|
|
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @Column(type="integer", nullable=true) |
73
|
|
|
*/ |
74
|
|
|
private ?int $close_combat_score = null; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @Column(type="integer", nullable=true) |
78
|
|
|
*/ |
79
|
|
|
private ?int $positive_effect_primary_commodity_id = null; |
|
|
|
|
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @Column(type="integer", nullable=true) |
83
|
|
|
*/ |
84
|
|
|
private ?int $positive_effect_secondary_commodity_id = null; |
|
|
|
|
85
|
|
|
|
86
|
|
|
//TODO survivor_rate to escape pods |
87
|
|
|
/** |
88
|
|
|
* |
89
|
|
|
* @ManyToOne(targetEntity="Research") |
90
|
|
|
* @JoinColumn(name="start_research_id", referencedColumnName="id") |
91
|
|
|
*/ |
92
|
|
|
private ?ResearchInterface $start_research = null; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @ManyToOne(targetEntity="Map") |
96
|
|
|
* @JoinColumn(name="start_map_id", referencedColumnName="id") |
97
|
|
|
*/ |
98
|
|
|
private ?MapInterface $start_map = null; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @ManyToOne(targetEntity="Stu\Orm\Entity\Commodity") |
102
|
|
|
* @JoinColumn(name="positive_effect_primary_commodity_id", referencedColumnName="id") |
103
|
|
|
*/ |
104
|
|
|
private ?CommodityInterface $primaryEffectCommodity; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @ManyToOne(targetEntity="Stu\Orm\Entity\Commodity") |
108
|
|
|
* @JoinColumn(name="positive_effect_secondary_commodity_id", referencedColumnName="id") |
109
|
|
|
*/ |
110
|
|
|
private ?CommodityInterface $secondaryEffectCommodity; |
111
|
|
|
|
112
|
|
|
public function getId(): int |
113
|
|
|
{ |
114
|
|
|
return $this->id; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
public function getName(): string |
118
|
|
|
{ |
119
|
|
|
return $this->name; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
public function setName(string $name): FactionInterface |
123
|
|
|
{ |
124
|
|
|
$this->name = $name; |
125
|
|
|
|
126
|
|
|
return $this; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
public function getDescription(): string |
130
|
|
|
{ |
131
|
|
|
return $this->description; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
public function setDescription(string $description): FactionInterface |
135
|
|
|
{ |
136
|
|
|
$this->description = $description; |
137
|
|
|
|
138
|
|
|
return $this; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function getDarkerColor(): string |
142
|
|
|
{ |
143
|
|
|
return $this->darker_color; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
public function setDarkerColor(string $darkerColor): FactionInterface |
147
|
|
|
{ |
148
|
|
|
$this->darker_color = $darkerColor; |
149
|
|
|
|
150
|
|
|
return $this; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
public function getChooseable(): bool |
154
|
|
|
{ |
155
|
|
|
return $this->chooseable; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
public function setChooseable(bool $chooseable): FactionInterface |
159
|
|
|
{ |
160
|
|
|
$this->chooseable = $chooseable; |
161
|
|
|
|
162
|
|
|
return $this; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
public function getPlayerLimit(): int |
166
|
|
|
{ |
167
|
|
|
return $this->player_limit; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
public function setPlayerLimit(int $playerLimit): FactionInterface |
171
|
|
|
{ |
172
|
|
|
$this->player_limit = $playerLimit; |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
public function getStartBuildingId(): int |
178
|
|
|
{ |
179
|
|
|
return $this->start_building_id; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
public function setStartBuildingId(int $startBuildingId): FactionInterface |
183
|
|
|
{ |
184
|
|
|
$this->start_building_id = $startBuildingId; |
185
|
|
|
|
186
|
|
|
return $this; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
public function getStartResearch(): ?ResearchInterface |
190
|
|
|
{ |
191
|
|
|
return $this->start_research; |
192
|
|
|
} |
193
|
|
|
|
194
|
|
|
public function setStartResearch(?ResearchInterface $start_research): FactionInterface |
195
|
|
|
{ |
196
|
|
|
$this->start_research = $start_research; |
197
|
|
|
return $this; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
public function getStartMap(): ?MapInterface |
201
|
|
|
{ |
202
|
|
|
return $this->start_map; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
public function setStartMap(?MapInterface $start_map): FactionInterface |
206
|
|
|
{ |
207
|
|
|
$this->start_map = $start_map; |
208
|
|
|
return $this; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
public function getCloseCombatScore(): ?int |
212
|
|
|
{ |
213
|
|
|
return $this->close_combat_score; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
public function getPrimaryEffectCommodity(): ?CommodityInterface |
217
|
|
|
{ |
218
|
|
|
return $this->primaryEffectCommodity; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
public function getSecondaryEffectCommodity(): ?CommodityInterface |
222
|
|
|
{ |
223
|
|
|
return $this->secondaryEffectCommodity; |
224
|
|
|
} |
225
|
|
|
} |
226
|
|
|
|