diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 347fe11d..814bba45 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -46,13 +46,13 @@ public enum ForgeManager implements Runnable { // otherwise roll what was asked for } - if (workOrder.total_to_produce == 0) { + if (workOrder.total_produced >= workOrder.total_to_produce) { workOrder.runCompleted = true; workOrder.vendor.workOrders.remove(workOrder); Logger.info("Workorder has completed: " + workOrder.workOrderID); - // Remove this workOrder from any slots on vendor + workOrder.vendor.workOrders.remove(workOrder); continue; } @@ -114,4 +114,14 @@ public enum ForgeManager implements Runnable { rollingDuration = (long) (baseTime * Float.parseFloat(ConfigManager.MB_PRODUCTION_RATE.getValue())); return rollingDuration; } + + public static int getAvailableSlots(WorkOrder workOrder) { + + int availableSlots = workOrder.vendor.getRank(); + + for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders) { + + } + return availableSlots; + } } diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index 6905789b..49fbb2d1 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -24,14 +24,15 @@ public class WorkOrder implements Delayed { public NPC vendor; public int slotCount; public int total_to_produce; + public int total_produced; public int templateID; public String itemName; public int prefixToken; public int suffixToken; public long rollingDuration; public long completionTime; - public boolean runCompleted; - public boolean runCanceled; + public boolean runCompleted = false; + public boolean runCanceled = false; public ArrayList cooking = new ArrayList<>();