MAPG-73 pass mapId to GameController and PositionController
adapt JS to send mapId make separate JS for the game
This commit is contained in:
1 parent
1ca023e612
commit
92c35a2087
6 files changed
+38
-51
No files matched your search
@@ -10,13 +10,13 @@ use MapGuesser\Interfaces\View\IView;
|
||||
|
||||
class GameController implements IController
|
||||
{
|
||||
private int $mapId;
|
||||
|
||||
private bool $jsonResponse;
|
||||
|
||||
// demo map
|
||||
private int $mapId = 1;
|
||||
|
||||
public function __construct($jsonResponse = false)
|
||||
public function __construct(int $mapId, $jsonResponse = false)
|
||||
{
|
||||
$this->mapId = $mapId;
|
||||
$this->jsonResponse = $jsonResponse;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class GameController implements IController
|
||||
];
|
||||
}
|
||||
|
||||
$data = ['bounds' => $bounds->toArray()];
|
||||
$data = ['mapId' => $this->mapId, 'bounds' => $bounds->toArray()];
|
||||
|
||||
if ($this->jsonResponse) {
|
||||
return new JsonView($data);
|
||||
|
||||
Reference in new issue
Block a user