Пример #1
0
 /**
  * @return Weight
  */
 public function getWeight()
 {
     return $this->weightTable->toWeight($this);
 }
 /**
  * @test
  * @expectedException \DrdPlus\Tables\Measurements\Partials\Exceptions\BonusRequiresInteger
  * @expectedExceptionMessageRegExp ~tiny~
  */
 public function I_can_not_convert_non_number_as_simplified_weight_bonus_to_bonus()
 {
     $weightTable = new WeightTable();
     $weightTable->getBonusFromSimplifiedBonus('tiny');
 }
Пример #3
0
 /**
  * @return AbstractBonus
  */
 public function getBonus()
 {
     return $this->weightTable->toBonus($this);
 }
Пример #4
0
 /**
  * @param RaceCode $raceCode
  * @param SubraceCode $subraceCode
  * @param FemaleModifiersTable $femaleModifiersTable
  * @param WeightTable $weightTable
  * @return float
  */
 public function getFemaleWeightInKg($raceCode, $subraceCode, FemaleModifiersTable $femaleModifiersTable, WeightTable $weightTable)
 {
     $maleWeightValue = $this->getMaleWeightInKg($raceCode, $subraceCode);
     $maleWeightBonus = $weightTable->toBonus(new Weight($maleWeightValue, Weight::KG, $weightTable));
     $femaleWeightBonusModifier = $femaleModifiersTable->getWeightBonus($raceCode);
     $femaleWeightBonusValue = $maleWeightBonus->getValue() + $femaleWeightBonusModifier;
     /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
     $femaleWeightBonus = new WeightBonus($femaleWeightBonusValue, $weightTable);
     return $femaleWeightBonus->getWeight()->getValue();
 }