2016-11-19 09:27:43 +01:00
|
|
|
package com.gamingmesh.jobs.container;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
public class BoostMultiplier {
|
|
|
|
|
2017-01-10 12:48:40 +01:00
|
|
|
HashMap<CurrencyType, Double> map = new HashMap<CurrencyType, Double>();
|
2016-11-19 09:27:43 +01:00
|
|
|
|
2017-01-10 14:32:20 +01:00
|
|
|
@Override
|
|
|
|
public BoostMultiplier clone() {
|
|
|
|
BoostMultiplier boost = new BoostMultiplier();
|
|
|
|
for (CurrencyType type : CurrencyType.values()) {
|
|
|
|
boost.add(type, map.get(type));
|
|
|
|
}
|
|
|
|
return boost;
|
|
|
|
}
|
|
|
|
|
2016-11-19 09:27:43 +01:00
|
|
|
public BoostMultiplier() {
|
2017-01-10 12:48:40 +01:00
|
|
|
for (CurrencyType one : CurrencyType.values()) {
|
2016-11-19 09:27:43 +01:00
|
|
|
map.put(one, 0D);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-10 12:48:40 +01:00
|
|
|
public BoostMultiplier add(CurrencyType type, double amount) {
|
2016-11-19 09:27:43 +01:00
|
|
|
map.put(type, amount);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BoostMultiplier add(double amount) {
|
2017-01-10 12:48:40 +01:00
|
|
|
for (CurrencyType one : CurrencyType.values()) {
|
2016-11-19 09:27:43 +01:00
|
|
|
map.put(one, amount);
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2017-01-10 12:48:40 +01:00
|
|
|
public double get(CurrencyType type) {
|
2016-11-19 09:27:43 +01:00
|
|
|
if (!map.containsKey(type))
|
|
|
|
return 0D;
|
|
|
|
return this.map.get(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void add(BoostMultiplier armorboost) {
|
2017-01-10 12:48:40 +01:00
|
|
|
for (CurrencyType one : CurrencyType.values()) {
|
2016-11-19 09:27:43 +01:00
|
|
|
double r = armorboost.get(one);
|
|
|
|
map.put(one, get(one) + r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|