Esempio n. 1
0
 public function __construct(HeightInCm $heightInCm, DistanceTable $distanceTable)
 {
     $heightInMeters = $heightInCm->getValue() / 100;
     /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
     $distance = new Distance($heightInMeters, Distance::M, $distanceTable);
     // height is bonus of distance in fact
     $this->value = $distance->getBonus()->getValue();
 }
 /**
  * @param Race $race
  * @param GenderCode $genderCode
  * @param ExceptionalityProperties $exceptionalityProperties
  * @param ProfessionLevels $professionLevels
  * @param WeightInKg $weightInKgAdjustment
  * @param HeightInCm $heightInCmAdjustment
  * @param Age $age
  * @param Tables $tables
  * @throws Exceptions\TooLowStrengthAdjustment
  */
 public function __construct(Race $race, GenderCode $genderCode, ExceptionalityProperties $exceptionalityProperties, ProfessionLevels $professionLevels, WeightInKg $weightInKgAdjustment, HeightInCm $heightInCmAdjustment, Age $age, Tables $tables)
 {
     $this->exceptionalityProperties = $exceptionalityProperties;
     $this->setUpBaseProperties($race, $genderCode, $exceptionalityProperties, $professionLevels, $tables);
     $this->firstLevelWeightInKgAdjustment = $weightInKgAdjustment;
     $this->firstLevelWeightInKg = $this->createFirstLevelWeightInKg($race, $genderCode, $weightInKgAdjustment, $tables);
     $this->firstLevelSize = $this->createFirstLevelSize($race, $genderCode, $tables, $exceptionalityProperties, $professionLevels);
     $this->firstLevelHeightInCmAdjustment = $heightInCmAdjustment;
     $this->firstLevelHeightInCm = HeightInCm::getIt($race->getHeightInCm($tables->getRacesTable()) + $heightInCmAdjustment->getValue());
     $this->firstLevelHeight = new Height($this->firstLevelHeightInCm, $tables->getDistanceTable());
     $this->firstLevelAge = $age;
 }