use of delta.games.lotro.character.stats.ratings.RatingCurve in project lotro-companion by dmorcellet.
the class StatCurvesConfigurationFactory method buildCriticalDefenceChart.
/**
* Build configuration for the 'critical defence' chart.
* @return A chart configuration.
*/
public StatCurvesChartConfiguration buildCriticalDefenceChart() {
RatingCurve critDefence = _ratingsMgr.getCriticalDefence();
StatCurvesChartConfiguration criticalDefenceCfg = new StatCurvesChartConfiguration("Critical Defence", STAT.CRITICAL_DEFENCE);
SingleStatCurveConfiguration criticalDefenceCurveCfg = new SingleStatCurveConfiguration("Critical Defence", critDefence);
criticalDefenceCurveCfg.addStat(STAT.MELEE_CRITICAL_DEFENCE);
criticalDefenceCurveCfg.addStat(STAT.RANGED_CRITICAL_DEFENCE);
criticalDefenceCurveCfg.addStat(STAT.TACTICAL_CRITICAL_DEFENCE);
criticalDefenceCfg.addCurve(criticalDefenceCurveCfg);
return criticalDefenceCfg;
}
use of delta.games.lotro.character.stats.ratings.RatingCurve in project lotro-companion by dmorcellet.
the class StatCurvesConfigurationFactory method buildHealingChart.
/**
* Build configuration for the 'healing' chart.
* @return A chart configuration.
*/
public StatCurvesChartConfiguration buildHealingChart() {
RatingCurve healing = _ratingsMgr.getHealing();
StatCurvesChartConfiguration healingCfg = new StatCurvesChartConfiguration("Healing", STAT.OUTGOING_HEALING);
SingleStatCurveConfiguration healingCurveCfg = new SingleStatCurveConfiguration("Healing", healing);
healingCurveCfg.addStat(STAT.OUTGOING_HEALING_PERCENTAGE);
healingCfg.addCurve(healingCurveCfg);
return healingCfg;
}
use of delta.games.lotro.character.stats.ratings.RatingCurve in project lotro-companion by dmorcellet.
the class StatValuesPanelController method getStatValue.
private FixedDecimalsInteger getStatValue(SingleStatCurveConfiguration config, int level, FixedDecimalsInteger baseStatValue) {
RatingCurve curve = config.getCurve();
double value = (baseStatValue != null) ? baseStatValue.doubleValue() : 0.0;
Double result = curve.getPercentage(value, level);
FixedDecimalsInteger ret = (result != null) ? new FixedDecimalsInteger(result.floatValue()) : null;
return ret;
}
use of delta.games.lotro.character.stats.ratings.RatingCurve in project lotro-companion by dmorcellet.
the class StatCurvesChartConfiguration method getAutoMaxRating.
/**
* Automagically compute value of the maximum rating for this curve.
* @return A rating value.
*/
public double getAutoMaxRating() {
double max = 0;
for (SingleStatCurveConfiguration config : _curves) {
RatingCurve curve = config.getCurve();
Double rating = curve.getRatingForCap(_level);
// System.out.println("Found rating "+rating+" for cap of curve "+config.getTitle()+" at level "+_level);
if (rating != null) {
if (rating.doubleValue() > max) {
max = rating.doubleValue();
}
}
}
return max;
}
use of delta.games.lotro.character.stats.ratings.RatingCurve in project lotro-companion by dmorcellet.
the class StatCurveChartPanelController method updateCurveLineSeries.
private void updateCurveLineSeries(XYSeries curveLineSeries, SingleStatCurveConfiguration curveConfiguration) {
curveLineSeries.clear();
double minRating = _config.getMinRating();
double maxRating = _config.getMaxRating();
double step = (maxRating - minRating) / NB_POINTS;
int level = _config.getLevel();
RatingCurve curve = curveConfiguration.getCurve();
for (int i = 0; i < NB_POINTS; i++) {
double rating = minRating + i * step;
Double percentage = curve.getPercentage(rating, level);
if (percentage != null) {
curveLineSeries.add(rating, percentage.doubleValue());
}
}
}
Aggregations