From 19c6cd76a95afb4200e5d0d68356ab8e3d258a4d Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 22 Apr 2024 13:43:22 -0400 Subject: [PATCH] Warehouse updated for org.json --- src/engine/gameManager/ForgeManager.java | 2 -- src/engine/objects/Warehouse.java | 18 +----------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index f38ff8e0..5423d5b7 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -144,8 +144,6 @@ public enum ForgeManager implements Runnable { forge.add(workOrder); JSONObject jsonWorkOrder = WorkOrder.toJson(workOrder); - String stringOrder = jsonWorkOrder.toString(); - stringOrder = stringOrder.trim(); } catch (Exception e) { Logger.error(e); diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index f15a6611..58c3a06f 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -58,7 +58,7 @@ public class Warehouse { for (String key : resources.keySet()) { mbEnums.ResourceType resourceType = mbEnums.ResourceType.valueOf(key); - int value = ((Long) resources.get(key)).intValue(); + int value = resources.getInt(key); this.resources.put(resourceType, value); } @@ -70,22 +70,6 @@ public class Warehouse { } - public static HashMap - calculateWarehouseOverdraft(Warehouse warehouse, HashMap costMap) { - - HashMap overdraft = new HashMap<>(); - - for (mbEnums.ResourceType resourceType : costMap.keySet()) { - - int cost = costMap.get(resourceType); - - if (cost > warehouse.resources.get(resourceType)) - overdraft.put(resourceType, cost - warehouse.resources.get(resourceType)); - } - - return overdraft; - } - public static void warehouseDeposit(MerchantMsg msg, PlayerCharacter player, NPC npc) { Building warehouseBuilding;