예제 #1
0
 /**
  * @param SkillRank $skillRank
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  */
 private function guardRelatedSkillOfRank(SkillRank $skillRank)
 {
     if ($this !== $skillRank->getSkill()) {
         if (static::class !== get_class($skillRank->getSkill())) {
             throw new Exceptions\CanNotVerifyOwningSkill('New skill rank belongs to different skill class. Expected ' . static::class . ', got ' . get_class($skillRank->getSkill()));
         } else {
             throw new Exceptions\CanNotVerifyOwningSkill('New skill rank belongs to different instance of skill class ' . static::class);
         }
     }
 }
 /**
  * @param PsychicalSkill $psychicalSkill
  * @param PsychicalSkillPoint $psychicalSkillPoint
  * @param PositiveInteger $requiredRankValue
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyPaidSkillPoint
  */
 public function __construct(PsychicalSkill $psychicalSkill, PsychicalSkillPoint $psychicalSkillPoint, PositiveInteger $requiredRankValue)
 {
     $this->psychicalSkill = $psychicalSkill;
     $this->psychicalSkillPoint = $psychicalSkillPoint;
     parent::__construct($psychicalSkill, $psychicalSkillPoint, $requiredRankValue);
 }
 public function __construct(Skill $owningSkill, SkillPoint $skillPoint, PositiveInteger $requiredRankValue)
 {
     $this->skill = $owningSkill;
     parent::__construct($owningSkill, $skillPoint, $requiredRankValue);
 }
 /**
  * @param CombinedSkill $combinedSkill
  * @param CombinedSkillPoint $combinedSkillPoint
  * @param PositiveInteger $requiredRankValue
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyPaidSkillPoint
  */
 public function __construct(CombinedSkill $combinedSkill, CombinedSkillPoint $combinedSkillPoint, PositiveInteger $requiredRankValue)
 {
     $this->combinedSkill = $combinedSkill;
     $this->combinedSkillPoint = $combinedSkillPoint;
     parent::__construct($combinedSkill, $combinedSkillPoint, $requiredRankValue);
 }