|
|
|
@ -640,4 +640,16 @@ public class Warehouse {
@@ -640,4 +640,16 @@ public class Warehouse {
|
|
|
|
|
return warehouse.locked.contains(resourceType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static HashMap<mbEnums.ResourceType, Integer> calcOverflow(Warehouse warehouse, HashMap<mbEnums.ResourceType, Integer> cost_map) { |
|
|
|
|
|
|
|
|
|
HashMap<mbEnums.ResourceType, Integer> overflowMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
for (mbEnums.ResourceType resourceType : cost_map.keySet()) { |
|
|
|
|
int debit = warehouse.resources.get(resourceType) - cost_map.get(resourceType); |
|
|
|
|
if (debit < 0) |
|
|
|
|
overflowMap.put(resourceType, debit); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return overflowMap; |
|
|
|
|
} |
|
|
|
|
} |