Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function handle(GameControllerInterface $game): void |
||
26 | { |
||
27 | $user = $game->getUser(); |
||
28 | |||
29 | $buoy = $this->buoyRepository->find( |
||
30 | request::indInt('id') |
||
31 | ); |
||
32 | |||
33 | |||
34 | $game->setPageTitle("Boje analysieren"); |
||
35 | $game->setMacroInAjaxWindow('html/shipmacros.xhtml/analysebuoy'); |
||
36 | |||
37 | $game->setTemplateVar('ERROR', true); |
||
38 | |||
39 | if ($buoy !== null) { |
||
40 | $amplitude = $buoy->getId() * $buoy->getUserId(); |
||
41 | } else { |
||
42 | $amplitude = 0; |
||
43 | } |
||
44 | $wavelength = ceil($amplitude / 2); |
||
45 | |||
46 | $game->setTemplateVar('AMPLITUDE', $amplitude); |
||
47 | $game->setTemplateVar('WAVELENGTH', $wavelength); |
||
48 | |||
49 | |||
50 | |||
51 | $game->setTemplateVar('BUOY', $buoy); |
||
52 | $game->setTemplateVar('USER', $user); |
||
53 | } |
||
55 |