From 1429a3a4d55681b6c65c0d722a4f4b9547ad53ae Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 10 Apr 2024 16:06:09 -0400 Subject: [PATCH] Configure upon submit() --- src/engine/gameManager/ForgeManager.java | 9 +++++++++ src/engine/loot/WorkOrder.java | 3 +++ .../net/client/handlers/ItemProductionMsgHandler.java | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 4053c126..ee7993e8 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -9,6 +9,7 @@ package engine.gameManager; import engine.loot.WorkOrder; +import engine.mbEnums; import engine.objects.Item; import engine.objects.PlayerCharacter; import org.pmw.tinylog.Logger; @@ -88,6 +89,8 @@ public enum ForgeManager implements Runnable { workOrder.workOrderID = wordOrderCounter.incrementAndGet(); workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration; workOrder.slotCount = calcAvailableSlots(workOrder); + workOrder.production_cost = calcProductionCost(workOrder); + workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder); // Single item rolls are total_to_produce of 0; @@ -144,4 +147,10 @@ public enum ForgeManager implements Runnable { return availableSlots; } + + public static HashMap calcProductionCost(WorkOrder workOrder) { + HashMap production_cost = new HashMap<>(); + + return production_cost; + } } diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index 3fe3508b..87ca5455 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -8,11 +8,13 @@ package engine.loot; +import engine.mbEnums; import engine.objects.Item; import engine.objects.NPC; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.HashMap; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; @@ -25,6 +27,7 @@ public class WorkOrder implements Delayed { public int slotCount; public int total_to_produce; public int total_produced; + public HashMap production_cost = new HashMap<>(); public int templateID; public String itemName; public int prefixToken; diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 308a4209..953ff486 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -86,7 +86,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.prefixToken = msg.pToken; workOrder.suffixToken = msg.sToken; workOrder.itemName = msg.name; - workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder); workOrder.slotCount = 0; // Validate vendor can roll this item