private function toWoundsBonus(Experiences $experiences) { $experiencesValue = $experiences->getValue(); do { $woundsBonus = $this->woundsTable->toBonus(new Wounds($experiencesValue--, $this->woundsTable, Wounds::WOUNDS)); /** * avoiding standard bonus round-up, which is unacceptable for experiences to level conversion; * @see \DrdPlus\Tables\Measurements\Partials\AbstractFileTable::determineBonus */ } while ($woundsBonus->getWounds()->getValue() > $experiences->getValue()); return $woundsBonus; }
/** * @test * @expectedException \DrdPlus\Tables\Measurements\Partials\Exceptions\RequestedDataOutOfTableRange */ public function I_can_not_convert_too_high_value_to_bonus() { $woundsTable = new WoundsTable(); $woundsTable->toBonus(new Wounds(28001, $woundsTable)); }
/** * @param Fatigue $fatigue * * @return FatigueBonus */ public function toBonus(Fatigue $fatigue) { return new FatigueBonus($this->woundsTable->toBonus(new Wounds($fatigue->getValue(), $this->woundsTable, Wounds::WOUNDS))->getValue(), $this); }
/** * @return WoundsBonus */ public function getBonus() { return $this->woundsTable->toBonus($this); }