private function checkRequiredRankValue(PositiveInteger $requiredRankValue) { if ($requiredRankValue->getValue() < self::MIN_RANK_VALUE) { throw new \LogicException('Rank value can not be lower than ' . self::MIN_RANK_VALUE . ', got ' . $requiredRankValue); } if ($requiredRankValue->getValue() > self::MAX_RANK_VALUE) { throw new \LogicException('Rank value can not be greater than ' . self::MIN_RANK_VALUE . ' got ' . $requiredRankValue); } }
/** * Applicable to lower shield or armor Restriction (Fight number malus), but can not make it positive. * * @param ProtectiveArmamentCode $protectiveArmamentCode * @param PositiveInteger $protectiveArmamentSkillRank * @return int * @throws \DrdPlus\Tables\Armaments\Partials\Exceptions\UnexpectedSkillRank */ public function getProtectiveArmamentRestrictionBonusForSkillRank(ProtectiveArmamentCode $protectiveArmamentCode, PositiveInteger $protectiveArmamentSkillRank) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $this->tables->getProtectiveArmamentMissingSkillTableByCode($protectiveArmamentCode)->getRestrictionBonusForSkillRank($protectiveArmamentSkillRank->getValue()); }