/** * @param GameStarted $event */ public function applyGameStarted(GameStarted $event) { $this->gameId = $event->getGameId(); $this->word = new WordChecker($event->getWord()); $this->tries = new TryCounter(8); $this->lettersCorrectlyGuessed = new LetterSaver(); $this->lettersWrongGuessed = new LetterSaver(); }
/** * @param GameStartedEvent $event */ public function applyGameStarted(GameStartedEvent $event) { $readModel = new Game($event->getGameId(), $event->getWord()); $this->repository->save($readModel); }
public function applyGameStarted(GameStarted $event) { $this->gameId = $event->getGameId(); $this->word = $event->getWord(); }