/** * Create a new game, and persist relevant entities to the database * @param int $scenario */ public function createGame($scenario = 1) { $sh = new Stronghold(); $p1 = $this->phaseRepository->getStartingPhase($scenario); $sh->setPhase($p1); $sh->setCurrentSide($this->sideRepository->getSideByAbbreviation('INV')); $stack = new ActionStack(); $sh->setActionStack($stack); $this->game = $sh; $this->saveGame(); $this->log->addText('Game created - ID = ' . $sh->getID()); }