/** * @param IntegerInterface $firstProperty * @param IntegerInterface $secondProperty * @param Charisma $charisma */ protected function __construct(IntegerInterface $firstProperty, IntegerInterface $secondProperty, Charisma $charisma) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct(SumAndRound::average($firstProperty->getValue(), $secondProperty->getValue()) + SumAndRound::half($charisma->getValue())); }
/** * @return int 0+ */ public function getCharismaLossBecauseOfLimit() { return $this->firstLevelUnlimitedCharisma->getValue() - $this->getFirstLevelCharisma()->getValue(); }
private function sumProperties(Strength $strengthIncrement, Agility $agilityIncrement, Knack $knackIncrement, Will $willIncrement, Intelligence $intelligenceIncrement, Charisma $charismaIncrement) { return $strengthIncrement->getValue() + $agilityIncrement->getValue() + $knackIncrement->getValue() + $willIncrement->getValue() + $intelligenceIncrement->getValue() + $charismaIncrement->getValue(); }