From 44eafc33450b4e863f0cff8bd113ac8c8c1e229c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 12 Apr 2024 17:41:08 -0400 Subject: [PATCH] Validation work --- src/engine/gameManager/ForgeManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 0f159c0a..9d0ceca6 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -149,7 +149,11 @@ public enum ForgeManager implements Runnable { return false; } - // use Warehouse.caclulateOverdraft(workorder) method + if (calcCostOverflow(workOrder).isEmpty() == false) { + if (playerCharacter != null) + ErrorPopupMsg.sendErrorPopup(playerCharacter, 18); //18: You can't really afford that + return false; + } return true; } @@ -220,7 +224,7 @@ public enum ForgeManager implements Runnable { return production_cost; } - public static HashMap calculateCostOverflow(WorkOrder workOrder) { + public static HashMap calcCostOverflow(WorkOrder workOrder) { HashMap costMap = new HashMap<>(); Warehouse warehouse;