1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-05 00:43:44 +01:00
Jobs/com/gamingmesh/jobs/container/BoostMultiplier.java
2017-01-10 15:32:20 +02:00

49 lines
1.1 KiB
Java

package com.gamingmesh.jobs.container;
import java.util.HashMap;
public class BoostMultiplier {
HashMap<CurrencyType, Double> map = new HashMap<CurrencyType, Double>();
@Override
public BoostMultiplier clone() {
BoostMultiplier boost = new BoostMultiplier();
for (CurrencyType type : CurrencyType.values()) {
boost.add(type, map.get(type));
}
return boost;
}
public BoostMultiplier() {
for (CurrencyType one : CurrencyType.values()) {
map.put(one, 0D);
}
}
public BoostMultiplier add(CurrencyType type, double amount) {
map.put(type, amount);
return this;
}
public BoostMultiplier add(double amount) {
for (CurrencyType one : CurrencyType.values()) {
map.put(one, amount);
}
return this;
}
public double get(CurrencyType type) {
if (!map.containsKey(type))
return 0D;
return this.map.get(type);
}
public void add(BoostMultiplier armorboost) {
for (CurrencyType one : CurrencyType.values()) {
double r = armorboost.get(one);
map.put(one, get(one) + r);
}
}
}