MAPG-44 modify game to use pov of place
This commit is contained in:
2 files changed
+21
-8
No files matched your search
@@ -41,7 +41,10 @@ class GameFlowController
|
||||
|
||||
$session->set('state', $state);
|
||||
|
||||
$data = ['panoId' => $place->getPanoIdCached()];
|
||||
$data = [
|
||||
'panoId' => $place->getPanoIdCached(),
|
||||
'pov' => $place->getPov()->toArray()
|
||||
];
|
||||
} else {
|
||||
$rounds = count($state['rounds']);
|
||||
$last = $state['rounds'][$rounds - 1];
|
||||
@@ -59,7 +62,10 @@ class GameFlowController
|
||||
|
||||
$data = [
|
||||
'history' => $history,
|
||||
'panoId' => $last['panoId']
|
||||
'panoId' => $last['panoId'],
|
||||
'pov' => isset($last['pov']) ? // should be checked not to break with old sessions
|
||||
$last['pov']->toArray() :
|
||||
['heading' => 0.0, 'pitch' => 0.0, 'zoom' => 0.0],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -103,10 +109,12 @@ class GameFlowController
|
||||
$this->addNewRoundToState($state, $place, $placesWithoutPano);
|
||||
|
||||
$panoId = $place->getPanoIdCached();
|
||||
$pov = $place->getPov()->toArray();
|
||||
} else {
|
||||
$state['rounds'] = [];
|
||||
|
||||
$panoId = null;
|
||||
$pov = null;
|
||||
}
|
||||
|
||||
$session->set('state', $state);
|
||||
@@ -117,7 +125,8 @@ class GameFlowController
|
||||
'distance' => $distance,
|
||||
'score' => $score
|
||||
],
|
||||
'panoId' => $panoId
|
||||
'panoId' => $panoId,
|
||||
'pov' => $pov
|
||||
];
|
||||
return new JsonContent($data);
|
||||
}
|
||||
@@ -128,7 +137,8 @@ class GameFlowController
|
||||
'placesWithoutPano' => $placesWithoutPano,
|
||||
'placeId' => $place->getId(),
|
||||
'position' => $place->getPosition(),
|
||||
'panoId' => $place->getPanoIdCached()
|
||||
'panoId' => $place->getPanoIdCached(),
|
||||
'pov' => $place->getPov()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user