Total Complexity | 8 |
Total Lines | 120 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class GamePlay |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $gameId; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $playerId; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $contextType; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $contextId; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $score; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $payload; |
||
38 | |||
39 | /** |
||
40 | * GamePlay constructor. |
||
41 | * |
||
42 | * @param string $gameId |
||
43 | * @param string $playerId |
||
44 | * @param string $contextType |
||
45 | * @param string $contextId |
||
46 | * @param int $score |
||
47 | * @param string $payload |
||
48 | */ |
||
49 | public function __construct( |
||
50 | string $gameId, |
||
51 | string $playerId, |
||
52 | string $contextType, |
||
53 | string $contextId, |
||
54 | int $score, |
||
55 | string $payload |
||
56 | ) { |
||
57 | $this->gameId = $gameId; |
||
58 | $this->playerId = $playerId; |
||
59 | $this->contextType = $contextType; |
||
60 | $this->contextId = $contextId; |
||
61 | $this->score = $score; |
||
62 | $this->payload = $payload; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getGameId(): string |
||
69 | { |
||
70 | return $this->gameId; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getPlayerId(): string |
||
77 | { |
||
78 | return $this->playerId; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getContextType(): string |
||
85 | { |
||
86 | return $this->contextType; |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getContextId(): string |
||
93 | { |
||
94 | return $this->contextId; |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * @return int |
||
99 | */ |
||
100 | public function getScore(): int |
||
101 | { |
||
102 | return $this->score; |
||
103 | } |
||
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getPayload(): string |
||
109 | { |
||
110 | return $this->payload; |
||
111 | } |
||
112 | |||
113 | /** |
||
114 | * @param array $callbackData |
||
115 | * |
||
116 | * @return \Kerox\Messenger\Model\Callback\GamePlay |
||
117 | */ |
||
118 | public static function create(array $callbackData): self |
||
127 | ); |
||
128 | } |
||
129 | } |
||
130 |