Initial warehouse refactor

This commit is contained in:
2024-03-15 10:01:22 -04:00
parent 92f53b00b8
commit 97fa583f65
15 changed files with 268 additions and 385 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ public class EffectsBase {
private boolean isSuffix = false; //used by items
private String name = "";
private float value = 0;
private ConcurrentHashMap<ItemBase, Integer> resourceCosts = new ConcurrentHashMap<>();
private ConcurrentHashMap<Enum.ResourceType, Integer> resourceCosts = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, Boolean> sourceTypes = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
/**
@@ -727,11 +727,11 @@ public class EffectsBase {
this.value = Value;
}
public ConcurrentHashMap<ItemBase, Integer> getResourcesForEffect() {
public ConcurrentHashMap<Enum.ResourceType, Integer> getResourcesForEffect() {
if (this.resourceCosts.isEmpty()) {
ArrayList<EffectsResourceCosts> effectsCostList = DbManager.EffectsResourceCostsQueries.GET_ALL_EFFECT_RESOURCES(this.IDString);
for (EffectsResourceCosts erc : effectsCostList) {
this.resourceCosts.put(ItemBase.getItemBase(erc.getResourceID()), erc.getAmount());
this.resourceCosts.put(Enum.ResourceType.resourceLookup.get(erc.getResourceID()), erc.getAmount());
}
}
return this.resourceCosts;