/**
  * @param \GameDomain\Player\PlayerInterface $player
  * @param int                                $stepNumber
  *
  * @return bool
  */
 protected function play(PlayerInterface $player, $stepNumber)
 {
     return $this->getGameRules()->generateValidAnswer($stepNumber)->isSameAs($player->play($this->getGameRules(), $this->createStep($stepNumber)));
 }
Esempio n. 2
0
 /**
  * @param \GameDomain\Rule\AbstractRulesSet  $gameRules
  * @param \GameDomain\Player\PlayerInterface $player
  * @param \GameDomain\Round\Step\Step        $step
  *
  * @return \GameDomain\Round\Step\StepResult
  */
 protected function createStepResult(AbstractRulesSet $gameRules, PlayerInterface $player, Step $step)
 {
     return new StepResult($player, $player->play($gameRules, $step), $gameRules->generateValidAnswer($step->getRawValue()), $step);
 }