From 7b3741fc601f5c25c12e12ba2e04a5e52282ba45 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 13 Sep 2023 12:48:09 -0400 Subject: [PATCH] Header added --- src/engine/gameManager/ForgeManager.java | 38 +++++++++++++++++++++--- src/engine/loot/WorkOrder.java | 10 ++++++- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index b46954ce..cdf3a148 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.gameManager; import engine.loot.WorkOrder; @@ -14,11 +22,33 @@ public enum ForgeManager implements Runnable { @Override public void run() { - try { - WorkOrder workOrder = workQueue.take(); + while (true) { + + try { + + WorkOrder workOrder = workQueue.take(); + + workOrder.itemCount = workOrder.itemCount - 1; + + // Create workOrder item + + if (workOrder.itemCount == 0) { + + workOrder.runCompleted = true; + + // Remove this workOrder from any slots on vendor + + continue; + } + + // Resubmit workOrder + + workOrder.completionTime = System.currentTimeMillis() + 10000; + + } catch (InterruptedException e) { + e.printStackTrace(); + } - } catch (InterruptedException e) { - e.printStackTrace(); } } diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index bc0c9fc7..c699df2e 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -1,3 +1,11 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + package engine.loot; import org.jetbrains.annotations.NotNull; @@ -15,7 +23,7 @@ public class WorkOrder implements Delayed { public String prefix; public String suffix; public long completionTime; - public boolean canceled; + public boolean runCompleted; public WorkOrder() {