Пример #1
0
 /**
  * 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());
 }
Пример #2
0
 /**
  * Set game
  *
  * @param Stronghold $game
  * @return ActionStack
  */
 public function setGame(Stronghold $game = null)
 {
     $this->game = $game;
     $game->setActionStack($this);
     return $this;
 }