1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* CommercialShipping |
5
|
|
|
* |
6
|
|
|
* @author Jacky Casas |
7
|
|
|
* @copyright Expansion - le jeu |
8
|
|
|
* |
9
|
|
|
* @package Athena |
10
|
|
|
* @update 13.11.13 |
11
|
|
|
*/ |
12
|
|
|
namespace Asylamba\Modules\Athena\Model; |
13
|
|
|
|
14
|
|
|
class CommercialShipping { |
15
|
|
|
# statement |
16
|
|
|
const ST_WAITING = 0; # pret au départ, statique |
17
|
|
|
const ST_GOING = 1; # aller |
18
|
|
|
const ST_MOVING_BACK = 2; # retour |
19
|
|
|
|
20
|
|
|
const WEDGE = 1000; # soute |
21
|
|
|
|
22
|
|
|
# attributes |
23
|
|
|
public $id = 0; |
24
|
|
|
public $rPlayer = 0; |
25
|
|
|
public $rBase = 0; |
26
|
|
|
public $rBaseDestination = 0; |
27
|
|
|
public $rTransaction = NULL; # soit l'un |
28
|
|
|
public $resourceTransported = NULL; # soit l'autre |
29
|
|
|
public $shipQuantity = 0; |
30
|
|
|
public $dDeparture = ''; |
31
|
|
|
public $dArrival = ''; |
32
|
|
|
public $statement = 0; |
33
|
|
|
|
34
|
|
|
public $baseRSystem; |
35
|
|
|
public $basePosition; |
36
|
|
|
public $baseXSystem; |
37
|
|
|
public $baseYSystem; |
38
|
|
|
|
39
|
|
|
public $destinationRSystem; |
40
|
|
|
public $destinationPosition; |
41
|
|
|
public $destinationXSystem; |
42
|
|
|
public $destinationYSystem; |
43
|
|
|
|
44
|
|
|
public $price; |
45
|
|
|
public $typeOfTransaction; |
46
|
|
|
public $quantity; |
47
|
|
|
public $identifier; |
48
|
|
|
public $commanderAvatar; |
49
|
|
|
public $commanderName; |
50
|
|
|
public $commanderLevel; |
51
|
|
|
public $commanderVictory; |
52
|
|
|
public $commanderExperience; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param int $id |
56
|
|
|
* @return CommercialShipping |
57
|
|
|
*/ |
58
|
|
|
public function setId($id) |
59
|
|
|
{ |
60
|
|
|
$this->id = $id; |
61
|
|
|
|
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return int |
67
|
|
|
*/ |
68
|
|
|
public function getId() |
69
|
|
|
{ |
70
|
|
|
return $this->id; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param int $playerId |
75
|
|
|
* @return CommercialShipping |
76
|
|
|
*/ |
77
|
|
|
public function setPlayerId($playerId) |
78
|
|
|
{ |
79
|
|
|
$this->rPlayer = $playerId; |
80
|
|
|
|
81
|
|
|
return $this; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return int |
86
|
|
|
*/ |
87
|
|
|
public function getPlayerId() |
88
|
|
|
{ |
89
|
|
|
return $this->rPlayer; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param int $baseId |
94
|
|
|
* @return CommercialShipping |
95
|
|
|
*/ |
96
|
|
|
public function setBaseId($baseId) |
97
|
|
|
{ |
98
|
|
|
$this->rBase = $baseId; |
99
|
|
|
|
100
|
|
|
return $this; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @return int |
105
|
|
|
*/ |
106
|
|
|
public function getBaseId() |
107
|
|
|
{ |
108
|
|
|
return $this->rBase; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @param int $destinationId |
113
|
|
|
* @return CommercialShipping |
114
|
|
|
*/ |
115
|
|
|
public function setDestinationBaseId($destinationId) |
116
|
|
|
{ |
117
|
|
|
$this->rBaseDestination = $destinationId; |
118
|
|
|
|
119
|
|
|
return $this; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return int |
124
|
|
|
*/ |
125
|
|
|
public function getDestinationBaseId() |
126
|
|
|
{ |
127
|
|
|
return $this->rBaseDestination; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param int $transactionId |
132
|
|
|
* @return CommercialShipping |
133
|
|
|
*/ |
134
|
|
|
public function setTransactionId($transactionId) |
135
|
|
|
{ |
136
|
|
|
$this->rTransaction = $transactionId; |
137
|
|
|
|
138
|
|
|
return $this; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @return int |
143
|
|
|
*/ |
144
|
|
|
public function getTransactionId() |
145
|
|
|
{ |
146
|
|
|
return $this->rTransaction; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @param int $resources |
151
|
|
|
* @return CommercialShipping |
152
|
|
|
*/ |
153
|
|
|
public function setResources($resources) |
154
|
|
|
{ |
155
|
|
|
$this->resourceTransported = $resources; |
156
|
|
|
|
157
|
|
|
return $this; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @return int |
162
|
|
|
*/ |
163
|
|
|
public function getResources() |
164
|
|
|
{ |
165
|
|
|
return $this->resourceTransported; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param int $shipQuantity |
170
|
|
|
* @return CommercialShipping |
171
|
|
|
*/ |
172
|
|
|
public function setShipQuantity($shipQuantity) |
173
|
|
|
{ |
174
|
|
|
$this->shipQuantity = $shipQuantity; |
175
|
|
|
|
176
|
|
|
return $this; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @return int |
181
|
|
|
*/ |
182
|
|
|
public function getShipQuantity() |
183
|
|
|
{ |
184
|
|
|
return $this->shipQuantity; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @param string $departedAt |
189
|
|
|
* @return CommercialShipping |
190
|
|
|
*/ |
191
|
|
|
public function setDepartedAt($departedAt) |
192
|
|
|
{ |
193
|
|
|
$this->dDeparture = $departedAt; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @return string |
200
|
|
|
*/ |
201
|
|
|
public function getDepartedAt() |
202
|
|
|
{ |
203
|
|
|
return $this->dDeparture; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @param string $arrivedAt |
208
|
|
|
* @return CommercialShipping |
209
|
|
|
*/ |
210
|
|
|
public function setArrivedAt($arrivedAt) |
211
|
|
|
{ |
212
|
|
|
$this->dArrival = $arrivedAt; |
213
|
|
|
|
214
|
|
|
return $this; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @return string |
219
|
|
|
*/ |
220
|
|
|
public function getArrivedAt() |
221
|
|
|
{ |
222
|
|
|
return $this->dArrival; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @param int $statement |
227
|
|
|
* @return CommercialShipping |
228
|
|
|
*/ |
229
|
|
|
public function setStatement($statement) |
230
|
|
|
{ |
231
|
|
|
$this->statement = $statement; |
232
|
|
|
|
233
|
|
|
return $this; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @return int |
238
|
|
|
*/ |
239
|
|
|
public function getStatement() |
240
|
|
|
{ |
241
|
|
|
return $this->statement; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @param int $systemId |
246
|
|
|
* @return CommercialShipping |
247
|
|
|
*/ |
248
|
|
|
public function setBaseSystemId($systemId) |
249
|
|
|
{ |
250
|
|
|
$this->baseRSystem = $systemId; |
251
|
|
|
|
252
|
|
|
return $this; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @return int |
257
|
|
|
*/ |
258
|
|
|
public function getBaseSystemId() |
259
|
|
|
{ |
260
|
|
|
return $this->baseRSystem; |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* @param int $position |
265
|
|
|
* @return CommercialShipping |
266
|
|
|
*/ |
267
|
|
|
public function setBasePosition($position) |
268
|
|
|
{ |
269
|
|
|
$this->basePosition = $position; |
270
|
|
|
|
271
|
|
|
return $this; |
272
|
|
|
} |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @return int |
276
|
|
|
*/ |
277
|
|
|
public function getBasePosition() |
278
|
|
|
{ |
279
|
|
|
return $this->basePosition; |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
/** |
283
|
|
|
* @param int $xPosition |
284
|
|
|
* @return CommercialShipping |
285
|
|
|
*/ |
286
|
|
|
public function setBaseSystemXPosition($xPosition) |
287
|
|
|
{ |
288
|
|
|
$this->baseXSystem = $xPosition; |
289
|
|
|
|
290
|
|
|
return $this; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* @return int |
295
|
|
|
*/ |
296
|
|
|
public function getBaseSystemXPosition() |
297
|
|
|
{ |
298
|
|
|
return $this->baseXSystem; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* @param int $yPosition |
303
|
|
|
* @return CommercialShipping |
304
|
|
|
*/ |
305
|
|
|
public function setBaseSystemYPosition($yPosition) |
306
|
|
|
{ |
307
|
|
|
$this->baseYSystem = $yPosition; |
308
|
|
|
|
309
|
|
|
return $this; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* @return int |
314
|
|
|
*/ |
315
|
|
|
public function getBaseSystemYPosition() |
316
|
|
|
{ |
317
|
|
|
return $this->baseYSystem; |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* @param int $systemId |
322
|
|
|
* @return CommercialShipping |
323
|
|
|
*/ |
324
|
|
|
public function setDestinationBaseSystemId($systemId) |
325
|
|
|
{ |
326
|
|
|
$this->destinationRSystem = $systemId; |
327
|
|
|
|
328
|
|
|
return $this; |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
/** |
332
|
|
|
* @return int |
333
|
|
|
*/ |
334
|
|
|
public function getDestinationBaseSystemId() |
335
|
|
|
{ |
336
|
|
|
return $this->destinationRSystem; |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* @param int $position |
341
|
|
|
* @return CommercialShipping |
342
|
|
|
*/ |
343
|
|
|
public function setDestinationBasePosition($position) |
344
|
|
|
{ |
345
|
|
|
$this->destinationPosition = $position; |
346
|
|
|
|
347
|
|
|
return $this; |
348
|
|
|
} |
349
|
|
|
|
350
|
|
|
/** |
351
|
|
|
* @return int |
352
|
|
|
*/ |
353
|
|
|
public function getDestinationBasePosition() |
354
|
|
|
{ |
355
|
|
|
return $this->destinationPosition; |
356
|
|
|
} |
357
|
|
|
|
358
|
|
|
/** |
359
|
|
|
* @param int $xPosition |
360
|
|
|
* @return CommercialShipping |
361
|
|
|
*/ |
362
|
|
|
public function setDestinationBaseSystemXPosition($xPosition) |
363
|
|
|
{ |
364
|
|
|
$this->destinationXSystem = $xPosition; |
365
|
|
|
|
366
|
|
|
return $this; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* @return int |
371
|
|
|
*/ |
372
|
|
|
public function getDestinationBaseSystemXPosition() |
373
|
|
|
{ |
374
|
|
|
return $this->destinationXSystem; |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
/** |
378
|
|
|
* @param int $yPosition |
379
|
|
|
* @return CommercialShipping |
380
|
|
|
*/ |
381
|
|
|
public function setDestinationBaseSystemYPosition($yPosition) |
382
|
|
|
{ |
383
|
|
|
$this->destinationYSystem = $yPosition; |
384
|
|
|
|
385
|
|
|
return $this; |
386
|
|
|
} |
387
|
|
|
|
388
|
|
|
/** |
389
|
|
|
* @return int |
390
|
|
|
*/ |
391
|
|
|
public function getDestinationBaseSystemYPosition() |
392
|
|
|
{ |
393
|
|
|
return $this->destinationYSystem; |
394
|
|
|
} |
395
|
|
|
|
396
|
|
|
/** |
397
|
|
|
* @param int $price |
398
|
|
|
* @return CommercialShipping |
399
|
|
|
*/ |
400
|
|
|
public function setPrice($price) |
401
|
|
|
{ |
402
|
|
|
$this->price = $price; |
403
|
|
|
|
404
|
|
|
return $this; |
405
|
|
|
} |
406
|
|
|
|
407
|
|
|
/** |
408
|
|
|
* @return int |
409
|
|
|
*/ |
410
|
|
|
public function getPrice() |
411
|
|
|
{ |
412
|
|
|
return $this->price; |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* @param int $transactionType |
417
|
|
|
* @return CommercialShipping |
418
|
|
|
*/ |
419
|
|
|
public function setTransactionType($transactionType) |
420
|
|
|
{ |
421
|
|
|
$this->typeOfTransaction = $transactionType; |
422
|
|
|
|
423
|
|
|
return $this; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* @return int |
428
|
|
|
*/ |
429
|
|
|
public function getTransactionType() |
430
|
|
|
{ |
431
|
|
|
return $this->typeOfTransaction; |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* @param int $quantity |
436
|
|
|
* @return CommercialShipping |
437
|
|
|
*/ |
438
|
|
|
public function setQuantity($quantity) |
439
|
|
|
{ |
440
|
|
|
$this->quantity = $quantity; |
441
|
|
|
|
442
|
|
|
return $this; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* @return int |
447
|
|
|
*/ |
448
|
|
|
public function getQuantity() |
449
|
|
|
{ |
450
|
|
|
return $this->quantity; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/** |
454
|
|
|
* @param int $identifier |
455
|
|
|
* @return CommercialShipping |
456
|
|
|
*/ |
457
|
|
|
public function setIdentifier($identifier) |
458
|
|
|
{ |
459
|
|
|
$this->identifier = $identifier; |
460
|
|
|
|
461
|
|
|
return $this; |
462
|
|
|
} |
463
|
|
|
|
464
|
|
|
/** |
465
|
|
|
* @return int |
466
|
|
|
*/ |
467
|
|
|
public function getIdentifier() |
468
|
|
|
{ |
469
|
|
|
return $this->identifier; |
470
|
|
|
} |
471
|
|
|
|
472
|
|
|
/** |
473
|
|
|
* @param string $avatar |
474
|
|
|
* @return CommercialShipping |
475
|
|
|
*/ |
476
|
|
|
public function setCommanderAvatar($avatar) |
477
|
|
|
{ |
478
|
|
|
$this->commanderAvatar = $avatar; |
479
|
|
|
|
480
|
|
|
return $this; |
481
|
|
|
} |
482
|
|
|
|
483
|
|
|
/** |
484
|
|
|
* @return string |
485
|
|
|
*/ |
486
|
|
|
public function getCommanderAvatar() |
487
|
|
|
{ |
488
|
|
|
return $this->commanderAvatar; |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
/** |
492
|
|
|
* @param string $name |
493
|
|
|
* @return CommercialShipping |
494
|
|
|
*/ |
495
|
|
|
public function setCommanderName($name) |
496
|
|
|
{ |
497
|
|
|
$this->commanderName = $name; |
498
|
|
|
|
499
|
|
|
return $this; |
500
|
|
|
} |
501
|
|
|
|
502
|
|
|
/** |
503
|
|
|
* @return string |
504
|
|
|
*/ |
505
|
|
|
public function getCommanderName() |
506
|
|
|
{ |
507
|
|
|
return $this->commanderName; |
508
|
|
|
} |
509
|
|
|
|
510
|
|
|
/** |
511
|
|
|
* @param int $level |
512
|
|
|
* @return CommercialShipping |
513
|
|
|
*/ |
514
|
|
|
public function setCommanderLevel($level) |
515
|
|
|
{ |
516
|
|
|
$this->commanderLevel = $level; |
517
|
|
|
|
518
|
|
|
return $this; |
519
|
|
|
} |
520
|
|
|
|
521
|
|
|
/** |
522
|
|
|
* @return int |
523
|
|
|
*/ |
524
|
|
|
public function getCommanderLevel() |
525
|
|
|
{ |
526
|
|
|
return $this->commanderLevel; |
527
|
|
|
} |
528
|
|
|
|
529
|
|
|
/** |
530
|
|
|
* @param int $nbVictories |
531
|
|
|
* @return CommercialShipping |
532
|
|
|
*/ |
533
|
|
|
public function setCommanderVictory($nbVictories) |
534
|
|
|
{ |
535
|
|
|
$this->commanderVictory = $nbVictories; |
536
|
|
|
|
537
|
|
|
return $this; |
538
|
|
|
} |
539
|
|
|
|
540
|
|
|
/** |
541
|
|
|
* @return int |
542
|
|
|
*/ |
543
|
|
|
public function getCommanderVictory() |
544
|
|
|
{ |
545
|
|
|
return $this->commanderVictory; |
546
|
|
|
} |
547
|
|
|
|
548
|
|
|
/** |
549
|
|
|
* @param int $experience |
550
|
|
|
* @return CommercialShipping |
551
|
|
|
*/ |
552
|
|
|
public function setCommanderExperience($experience) |
553
|
|
|
{ |
554
|
|
|
$this->commanderExperience = $experience; |
555
|
|
|
|
556
|
|
|
return $this; |
557
|
|
|
} |
558
|
|
|
|
559
|
|
|
/** |
560
|
|
|
* @return int |
561
|
|
|
*/ |
562
|
|
|
public function getCommanderExperience() |
563
|
|
|
{ |
564
|
|
|
return $this->commanderExperience; |
565
|
|
|
} |
566
|
|
|
} |
567
|
|
|
|