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 { @@ -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<>();
for (Enum.ResourceType resourceType : costMap.keySet()) {
@ -112,7 +114,7 @@ public class Warehouse { @@ -112,7 +114,7 @@ public class Warehouse {
return;
if (!deposit(player, resource, depositAmount, true, true,warehouse)) {
if (!deposit(player, resource, depositAmount, true, true, warehouse)) {
return;
}
@ -144,7 +146,6 @@ public class Warehouse { @@ -144,7 +146,6 @@ public class Warehouse {
if (city == null)
return;
;
warehouse = city.warehouse;
@ -190,7 +191,6 @@ public class Warehouse { @@ -190,7 +191,6 @@ public class Warehouse {
if (city == null)
return;
;
warehouse = city.warehouse;

Loading…
Cancel
Save