private function createFortuneProperty(ProfessionLevel $professionLevel, ExceptionalityFate $fate, Integer1To6 $roll, $propertyCode, BasePropertiesFactory $basePropertiesFactory) { if ($professionLevel->isPrimaryProperty($propertyCode)) { $value = $fate->getPrimaryPropertyBonusOnFortune($roll); } else { $value = $fate->getSecondaryPropertyBonusOnFortune($roll); } return $basePropertiesFactory->createProperty($value, $propertyCode); }
/** * @param ProfessionLevel $newLevel * @param BaseProperty $propertyIncrement * @throws Exceptions\TooHighPrimaryPropertyIncrease * @throws Exceptions\TooHighSecondaryPropertyIncrease */ private function checkPropertyIncrementSequence(ProfessionLevel $newLevel, BaseProperty $propertyIncrement) { if ($propertyIncrement->getValue() > 0) { if ($newLevel->isPrimaryProperty($propertyIncrement->getCode())) { $this->checkPrimaryPropertyIncrementInARow($propertyIncrement); } else { $this->checkSecondaryPropertyIncrementInARow($propertyIncrement); } } }