diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index 0f30940d..2b0576ad 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -640,4 +640,16 @@ public class Warehouse { return warehouse.locked.contains(resourceType); } + public static HashMap calcOverflow(Warehouse warehouse, HashMap cost_map) { + + HashMap 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; + } } \ No newline at end of file