@Override public HardSoftScore toInitializedScore() { return initScore == 0 ? this : new HardSoftScore(0, hardScore, softScore); }
@Override public HardSoftScore negate() { return new HardSoftScore(-initScore, -hardScore, -softScore); }
public static HardSoftScore ofSoft(int softScore) { return new HardSoftScore(0, 0, softScore); }
public static HardSoftScore ofUninitialized(int initScore, int hardScore, int softScore) { return new HardSoftScore(initScore, hardScore, softScore); }
public static HardSoftScore of(int hardScore, int softScore) { return new HardSoftScore(0, hardScore, softScore); }
public static HardSoftScore ofHard(int hardScore) { return new HardSoftScore(0, hardScore, 0); }
/** * @deprecated in favor of {@link #ofUninitialized(int, int, int)} */ @Deprecated public static HardSoftScore valueOfUninitialized(int initScore, int hardScore, int softScore) { return new HardSoftScore(initScore, hardScore, softScore); }
/** * @deprecated in favor of {@link #of(int, int)} */ @Deprecated public static HardSoftScore valueOf(int hardScore, int softScore) { return new HardSoftScore(0, hardScore, softScore); }
@Override public HardSoftScore divide(double divisor) { return new HardSoftScore( (int) Math.floor(initScore / divisor), (int) Math.floor(hardScore / divisor), (int) Math.floor(softScore / divisor)); }
@Override public HardSoftScore multiply(double multiplicand) { return new HardSoftScore( (int) Math.floor(initScore * multiplicand), (int) Math.floor(hardScore * multiplicand), (int) Math.floor(softScore * multiplicand)); }
@Override public HardSoftScore power(double exponent) { return new HardSoftScore( (int) Math.floor(Math.pow(initScore, exponent)), (int) Math.floor(Math.pow(hardScore, exponent)), (int) Math.floor(Math.pow(softScore, exponent))); }
@Override public HardSoftScore withInitScore(int newInitScore) { assertNoInitScore(); return new HardSoftScore(newInitScore, hardScore, softScore); }
@Override public HardSoftScore add(HardSoftScore augment) { return new HardSoftScore( initScore + augment.getInitScore(), hardScore + augment.getHardScore(), softScore + augment.getSoftScore()); }
@Override public HardSoftScore subtract(HardSoftScore subtrahend) { return new HardSoftScore( initScore - subtrahend.getInitScore(), hardScore - subtrahend.getHardScore(), softScore - subtrahend.getSoftScore()); }