private function sumSpentPoints(Heritage $heritage, BackgroundSkillPoints $backgroundSkillPoints, BelongingsValue $belongingsValue) { return $heritage->getSpentBackgroundPoints() + $backgroundSkillPoints->getSpentBackgroundPoints() + $belongingsValue->getSpentBackgroundPoints(); }
private static function checkIfBackgroundSkillPointsAreTheSame(BackgroundSkillPoints $firstBackgroundSkillPoints, BackgroundSkillPoints $secondBackgroundSkillPoints) { if ($firstBackgroundSkillPoints->getSpentBackgroundPoints() !== $secondBackgroundSkillPoints->getSpentBackgroundPoints()) { throw new Exceptions\BackgroundSkillPointsAreNotSame('All skill points, originated in person background, have to use same background skill points.' . " Got different background skill points with values {$firstBackgroundSkillPoints->getSpentBackgroundPoints()}" . " and {$secondBackgroundSkillPoints->getSpentBackgroundPoints()}"); } }