Browse Source

Validation work

combat-2
MagicBot 7 months ago
parent
commit
44eafc3345
  1. 8
      src/engine/gameManager/ForgeManager.java

8
src/engine/gameManager/ForgeManager.java

@ -149,7 +149,11 @@ public enum ForgeManager implements Runnable { @@ -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 { @@ -220,7 +224,7 @@ public enum ForgeManager implements Runnable {
return production_cost;
}
public static HashMap<mbEnums.ResourceType, Integer> calculateCostOverflow(WorkOrder workOrder) {
public static HashMap<mbEnums.ResourceType, Integer> calcCostOverflow(WorkOrder workOrder) {
HashMap<mbEnums.ResourceType, Integer> costMap = new HashMap<>();
Warehouse warehouse;

Loading…
Cancel
Save