|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Research; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
8
|
|
|
use Stu\Component\Ship\System\ShipSystemManagerInterface; |
|
9
|
|
|
use Stu\Module\Award\Lib\CreateUserAwardInterface; |
|
10
|
|
|
use Stu\Module\Crew\Lib\CrewCreatorInterface; |
|
11
|
|
|
use Stu\Module\Database\Lib\CreateDatabaseEntryInterface; |
|
12
|
|
|
use Stu\Module\Message\Lib\PrivateMessageSenderInterface; |
|
13
|
|
|
use Stu\Module\Ship\Lib\ShipCreatorInterface; |
|
14
|
|
|
use Stu\Orm\Repository\ResearchedRepositoryInterface; |
|
15
|
|
|
use Stu\Orm\Repository\ShipRepositoryInterface; |
|
16
|
|
|
use Stu\Orm\Repository\ShipRumpUserRepositoryInterface; |
|
17
|
|
|
|
|
18
|
|
|
final class ResearchStateFactory implements ResearchStateFactoryInterface |
|
19
|
|
|
{ |
|
20
|
|
|
private ResearchedRepositoryInterface $researchedRepository; |
|
21
|
|
|
|
|
22
|
|
|
private ShipRumpUserRepositoryInterface $shipRumpUserRepository; |
|
23
|
|
|
|
|
24
|
|
|
private PrivateMessageSenderInterface $privateMessageSender; |
|
25
|
|
|
|
|
26
|
|
|
private CreateDatabaseEntryInterface $createDatabaseEntry; |
|
27
|
|
|
|
|
28
|
|
|
private CrewCreatorInterface $crewCreator; |
|
29
|
|
|
|
|
30
|
|
|
private ShipCreatorInterface $shipCreator; |
|
31
|
|
|
|
|
32
|
|
|
private ShipRepositoryInterface $shipRepository; |
|
33
|
|
|
|
|
34
|
|
|
private ShipSystemManagerInterface $shipSystemManager; |
|
35
|
|
|
|
|
36
|
|
|
private EntityManagerInterface $entityManager; |
|
37
|
|
|
|
|
38
|
|
|
private CreateUserAwardInterface $createUserAward; |
|
39
|
|
|
|
|
40
|
|
|
public function __construct( |
|
41
|
|
|
ResearchedRepositoryInterface $researchedRepository, |
|
42
|
|
|
ShipRumpUserRepositoryInterface $shipRumpUserRepository, |
|
43
|
|
|
PrivateMessageSenderInterface $privateMessageSender, |
|
44
|
|
|
CreateDatabaseEntryInterface $createDatabaseEntry, |
|
45
|
|
|
CrewCreatorInterface $crewCreator, |
|
46
|
|
|
ShipCreatorInterface $shipCreator, |
|
47
|
|
|
ShipRepositoryInterface $shipRepository, |
|
48
|
|
|
ShipSystemManagerInterface $shipSystemManager, |
|
49
|
|
|
CreateUserAwardInterface $createUserAward, |
|
50
|
|
|
EntityManagerInterface $entityManager |
|
51
|
|
|
) { |
|
52
|
|
|
$this->researchedRepository = $researchedRepository; |
|
53
|
|
|
$this->shipRumpUserRepository = $shipRumpUserRepository; |
|
54
|
|
|
$this->privateMessageSender = $privateMessageSender; |
|
55
|
|
|
$this->createDatabaseEntry = $createDatabaseEntry; |
|
56
|
|
|
$this->crewCreator = $crewCreator; |
|
57
|
|
|
$this->shipCreator = $shipCreator; |
|
58
|
|
|
$this->shipRepository = $shipRepository; |
|
59
|
|
|
$this->shipSystemManager = $shipSystemManager; |
|
60
|
|
|
$this->entityManager = $entityManager; |
|
61
|
|
|
$this->createUserAward = $createUserAward; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function createResearchState(): ResearchStateInterface |
|
65
|
|
|
{ |
|
66
|
|
|
return new ResearchState( |
|
67
|
|
|
$this->researchedRepository, |
|
68
|
|
|
$this->shipRumpUserRepository, |
|
69
|
|
|
$this->privateMessageSender, |
|
70
|
|
|
$this->createDatabaseEntry, |
|
71
|
|
|
$this->crewCreator, |
|
72
|
|
|
$this->shipCreator, |
|
73
|
|
|
$this->shipRepository, |
|
74
|
|
|
$this->shipSystemManager, |
|
75
|
|
|
$this->createUserAward, |
|
76
|
|
|
$this->entityManager, |
|
77
|
|
|
); |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|