Browse Source

Overdraft method written

combat-2
MagicBot 8 months ago
parent
commit
2e0ffe67fa
  1. 8
      src/engine/objects/Warehouse.java

8
src/engine/objects/Warehouse.java

@ -69,7 +69,9 @@ public class Warehouse {
} }
public static HashMap<Enum.ResourceType, Integer> calculateWarehouseOverdraft(Warehouse warehouse, HashMap<Enum.ResourceType, Integer> costMap) { public static HashMap<Enum.ResourceType, Integer>
calculateWarehouseOverdraft(Warehouse warehouse, HashMap<Enum.ResourceType, Integer> costMap) {
HashMap<Enum.ResourceType, Integer> overdraft = new HashMap<>(); HashMap<Enum.ResourceType, Integer> overdraft = new HashMap<>();
for (Enum.ResourceType resourceType : costMap.keySet()) { for (Enum.ResourceType resourceType : costMap.keySet()) {
@ -112,7 +114,7 @@ public class Warehouse {
return; return;
if (!deposit(player, resource, depositAmount, true, true,warehouse)) { if (!deposit(player, resource, depositAmount, true, true, warehouse)) {
return; return;
} }
@ -144,7 +146,6 @@ public class Warehouse {
if (city == null) if (city == null)
return; return;
;
warehouse = city.warehouse; warehouse = city.warehouse;
@ -190,7 +191,6 @@ public class Warehouse {
if (city == null) if (city == null)
return; return;
;
warehouse = city.warehouse; warehouse = city.warehouse;

Loading…
Cancel
Save