Search in sources :

Example 6 with RatingCurve

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;
}
Also used : RatingCurve(delta.games.lotro.character.stats.ratings.RatingCurve)

Example 7 with RatingCurve

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;
}
Also used : RatingCurve(delta.games.lotro.character.stats.ratings.RatingCurve)

Example 8 with RatingCurve

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;
}
Also used : FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) RatingCurve(delta.games.lotro.character.stats.ratings.RatingCurve)

Example 9 with RatingCurve

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;
}
Also used : RatingCurve(delta.games.lotro.character.stats.ratings.RatingCurve)

Example 10 with RatingCurve

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());
        }
    }
}
Also used : RatingCurve(delta.games.lotro.character.stats.ratings.RatingCurve) Paint(java.awt.Paint)

Aggregations

RatingCurve (delta.games.lotro.character.stats.ratings.RatingCurve)18 Paint (java.awt.Paint)2 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)1