1
1
package org .example .reader ;
2
2
3
-
4
- import org .example .domain .Trade ;
5
-
6
3
import java .text .DecimalFormat ;
7
4
8
5
public abstract class Emblem {
@@ -43,8 +40,8 @@ public void add(String currency, int amountTrade, double price, String name) {
43
40
}
44
41
if (currency .equals ("Exalted Orb" )) {
45
42
exaltedSpent += price ;
46
- maxPriceE = Math .max (price * Trade .getExPrice (), maxPriceE );
47
- minPriceE = (minPriceE == 0 ) ? price * Trade .getExPrice () : (Math .min (minPriceE , price * Trade .getExPrice ()));
43
+ maxPriceE = Math .max (price * ExaltedPrice .getExPrice (), maxPriceE );
44
+ minPriceE = (minPriceE == 0 ) ? price * ExaltedPrice .getExPrice () : (Math .min (minPriceE , price * ExaltedPrice .getExPrice ()));
48
45
}
49
46
}
50
47
@@ -54,13 +51,14 @@ public String toString() {
54
51
return emblemName
55
52
+ " -> TOTAL: " + amount
56
53
+ ", average: " + df .format (getAveragePrice ())
57
- + "c, c spent: " + chaosSpent
58
- + ", ex spent: " + df .format (exaltedSpent )
59
- + (splinters > 0 ? ", splinters left: " + splinters : "" );
54
+ + "c, spent: " + chaosSpent
55
+ + "c, " + df .format (exaltedSpent )
56
+ + "ex " + (splinters > 0 ? ", splinters left: " + splinters : "" )
57
+ + (totalSplinters > 0 ? "(" + totalSplinters + " for " + spentOnSplinters + "c)" : "" );
60
58
}
61
59
62
60
public double getAveragePrice () {
63
- double average = (chaosSpent + exaltedSpent * Trade .getExPrice ()) / amount ;
61
+ double average = (chaosSpent + exaltedSpent * ExaltedPrice .getExPrice ()) / amount ;
64
62
return (Double .isNaN (average ) || amount == 0 ) ? 0d : average ;
65
63
}
66
64
0 commit comments