コード例 #1
0
 public function onPostController(ResponseEvent $event)
 {
     $session = $event->getSession();
     if ($session->has('gameFinished')) {
         $session->clear();
         return;
     }
     $fleet = $this->battlefield->getFleet();
     $shots = $this->shotsManager->getAllShots();
     $hits = $this->shotsManager->getHits();
     $session->set('fleet', serialize($fleet));
     $session->set('shots', serialize($shots));
     $session->set('hits', serialize($hits));
 }