/** * Despite rules this library deducts half of size from defense number, instead of adding to attack number, * because it is more practical from numbers-point-of-view * PPH page 104 right column top * * @param DefenseNumber $defense * @param Size $size */ public function __construct(DefenseNumber $defense, Size $size) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct($defense->getValue() - SumAndRound::half($size->getValue())); }
/** * @param $value * @throws \Granam\Integer\Tools\Exceptions\WrongParameterType * @throws \Granam\Integer\Tools\Exceptions\ValueLostOnCast * @throws \Granam\Integer\Tools\Exceptions\PositiveIntegerCanNotBeNegative */ public function __construct($value) { parent::__construct($value); }
/** * @param Knack $knack */ public function __construct(Knack $knack) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct(SumAndRound::flooredHalf($knack->getValue())); }
/** * @param Agility $agility */ public function __construct(Agility $agility) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct(SumAndRound::ceiledHalf($agility->getValue())); }
/** * @param ProfessionCode $professionCode * @param BaseProperties $baseProperties * @param Height $height * @throws \DrdPlus\Properties\Combat\Exceptions\UnknownProfession */ public function __construct(ProfessionCode $professionCode, BaseProperties $baseProperties, Height $height) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct($this->calculateValue($professionCode, $baseProperties, $height)); }