/** * @param int $missingStrength * @param AthleticsInterface $athletics * @param MovementTypesTable $movementTypesTable * @return Time|false Gives false if there is no fatigue from current load at all * @throws \DrdPlus\Tables\Body\FatigueByLoad\Exceptions\OverloadedAndCanNotMove * @throws \Granam\Integer\Tools\Exceptions\WrongParameterType * @throws \Granam\Integer\Tools\Exceptions\ValueLostOnCast */ public function getPeriodForPointOfFatigue($missingStrength, AthleticsInterface $athletics, MovementTypesTable $movementTypesTable) { $desiredRow = $this->getRowFittingToMissingStrength($missingStrength, $athletics); /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $movementTypesTable->getPeriodForPointOfFatigue($desiredRow[self::WEARIES_LIKE]); }
/** * @param RidingAnimalMovementCode $ridingAnimalMovementCode * @return Time|false * @throws \Granam\Scalar\Tools\Exceptions\WrongParameterType */ public function getPeriodForPointOfFatigue(RidingAnimalMovementCode $ridingAnimalMovementCode) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $this->movementTypesTable->getPeriodForPointOfFatigue($this->getFatigueLike($ridingAnimalMovementCode)); }
/** * @test * @expectedException \DrdPlus\Tables\Body\MovementTypes\Exceptions\UnknownMovementType * @expectedExceptionMessageRegExp ~sneaking~ */ public function I_can_not_get_period_of_fatigue_for_unknown_type() { $movementTypesTable = new MovementTypesTable($this->speedTable, $this->timeTable); /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $movementTypesTable->getPeriodForPointOfFatigue('sneaking'); }