Completed
Pull Request — master (#167)
by
unknown
03:24
created

WidgetCurrentMap::onStartTurnEnd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\WidgetCurrentMap\Plugins;
4
5
use eXpansion\Bundle\WidgetCurrentMap\Plugins\Gui\CurrentMapWidgetFactory;
6
use eXpansion\Framework\Core\DataProviders\Listener\ListenerInterfaceExpApplication;
7
use eXpansion\Framework\Core\Model\UserGroups\Group;
8
use eXpansion\Framework\Core\Storage\PlayerStorage;
9
use eXpansion\Framework\GameManiaplanet\DataProviders\Listener\ListenerInterfaceMpScriptMatch;
10
use Maniaplanet\DedicatedServer\Connection;
11
12
13
class WidgetCurrentMap implements ListenerInterfaceExpApplication, ListenerInterfaceMpScriptMatch
14
{
15
    /** @var Connection */
16
    protected $connection;
17
    /**
18
     * @var PlayerStorage
19
     */
20
    private $playerStorage;
21
    /**
22
     * @var CurrentMapWidgetFactory
23
     */
24
    private $widget;
25
    /**
26
     * @var Group
27
     */
28
    private $players;
29
30
    /**
31
     * Debug constructor.
32
     *
33
     * @param Connection              $connection
34
     * @param PlayerStorage           $playerStorage
35
     * @param CurrentMapWidgetFactory $widget
36
     */
37 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38
        Connection $connection,
39
        PlayerStorage $playerStorage,
40
        CurrentMapWidgetFactory $widget,
41
        Group $players
42
    ) {
43
        $this->connection = $connection;
44
        $this->playerStorage = $playerStorage;
45
        $this->widget = $widget;
46
        $this->players = $players;
47
    }
48
49
    /**
50
     * called at eXpansion init
51
     *
52
     * @return void
53
     */
54
    public function onApplicationInit()
55
    {
56
57
58
    }
59
60
    /**
61
     * called when init is done and callbacks are enabled
62
     *
63
     * @return void
64
     */
65
    public function onApplicationReady()
66
    {
67
        $this->widget->create($this->players);
68
    }
69
70
    /**
71
     * called when requesting application stop
72
     *
73
     * @return void
74
     */
75
    public function onApplicationStop()
76
    {
77
78
    }
79
80
    /**
81
     * Callback sent when the "StartMatch" section start.
82
     *
83
     * @param int $count Each time this section is played, this number is incremented by one
84
     * @param int $time  Server time when the callback was sent
85
     *
86
     * @return void
87
     */
88
    public function onStartMatchStart($count, $time)
89
    {
90
        $this->widget->update($this->players);
91
    }
92
93
    /**
94
     * Callback sent when the "StartMatch" section end.
95
     *
96
     * @param int $count Each time this section is played, this number is incremented by one
97
     * @param int $time  Server time when the callback was sent
98
     *
99
     * @return void
100
     */
101
    public function onStartMatchEnd($count, $time)
102
    {
103
104
    }
105
106
    /**
107
     * Callback sent when the "EndMatch" section start.
108
     *
109
     * @param int $count Each time this section is played, this number is incremented by one
110
     * @param int $time  Server time when the callback was sent
111
     *
112
     * @return void
113
     */
114
    public function onEndMatchStart($count, $time)
115
    {
116
117
    }
118
119
    /**
120
     * Callback sent when the "EndMatch" section end.
121
     *
122
     * @param int $count Each time this section is played, this number is incremented by one
123
     * @param int $time  Server time when the callback was sent
124
     *
125
     * @return void
126
     */
127
    public function onEndMatchEnd($count, $time)
128
    {
129
130
    }
131
132
    /**
133
     * Callback sent when the "StartTurn" section start.
134
     *
135
     * @param int $count Each time this section is played, this number is incremented by one
136
     * @param int $time  Server time when the callback was sent
137
     *
138
     * @return void
139
     */
140
    public function onStartTurnStart($count, $time)
141
    {
142
143
    }
144
145
    /**
146
     * Callback sent when the "StartTurn" section end.
147
     *
148
     * @param int $count Each time this section is played, this number is incremented by one
149
     * @param int $time  Server time when the callback was sent
150
     *
151
     * @return void
152
     */
153
    public function onStartTurnEnd($count, $time)
154
    {
155
156
    }
157
158
    /**
159
     * Callback sent when the "EndMatch" section start.
160
     *
161
     * @param int $count Each time this section is played, this number is incremented by one
162
     * @param int $time  Server time when the callback was sent
163
     *
164
     * @return void
165
     */
166
    public function onEndTurnStart($count, $time)
167
    {
168
169
    }
170
171
    /**
172
     * Callback sent when the "EndMatch" section end.
173
     *
174
     * @param int $count Each time this section is played, this number is incremented by one
175
     * @param int $time  Server time when the callback was sent
176
     *
177
     * @return void
178
     */
179
    public function onEndTurnEnd($count, $time)
180
    {
181
182
    }
183
184
    /**
185
     * Callback sent when the "StartRound" section start.
186
     *
187
     * @param int $count Each time this section is played, this number is incremented by one
188
     * @param int $time  Server time when the callback was sent
189
     *
190
     * @return void
191
     */
192
    public function onStartRoundStart($count, $time)
193
    {
194
        // TODO: Implement onStartRoundStart() method.
195
    }
196
197
    /**
198
     * Callback sent when the "StartRound" section end.
199
     *
200
     * @param int $count Each time this section is played, this number is incremented by one
201
     * @param int $time  Server time when the callback was sent
202
     *
203
     * @return void
204
     */
205
    public function onStartRoundEnd($count, $time)
206
    {
207
208
    }
209
210
    /**
211
     * Callback sent when the "EndMatch" section start.
212
     *
213
     * @param int $count Each time this section is played, this number is incremented by one
214
     * @param int $time  Server time when the callback was sent
215
     *
216
     * @return void
217
     */
218
    public function onEndRoundStart($count, $time)
219
    {
220
    }
221
222
    /**
223
     * Callback sent when the "EndMatch" section end.
224
     *
225
     * @param int $count Each time this section is played, this number is incremented by one
226
     * @param int $time  Server time when the callback was sent
227
     *
228
     * @return void
229
     */
230
    public function onEndRoundEnd($count, $time)
231
    {
232
233
    }
234
}
235