Browse Source

Header added

feature-workorder
MagicBot 1 year ago
parent
commit
7b3741fc60
  1. 30
      src/engine/gameManager/ForgeManager.java
  2. 10
      src/engine/loot/WorkOrder.java

30
src/engine/gameManager/ForgeManager.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.gameManager; package engine.gameManager;
import engine.loot.WorkOrder; import engine.loot.WorkOrder;
@ -14,12 +22,34 @@ public enum ForgeManager implements Runnable {
@Override @Override
public void run() { public void run() {
while (true) {
try { try {
WorkOrder workOrder = workQueue.take(); 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) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
}
} }

10
src/engine/loot/WorkOrder.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -15,7 +23,7 @@ public class WorkOrder implements Delayed {
public String prefix; public String prefix;
public String suffix; public String suffix;
public long completionTime; public long completionTime;
public boolean canceled; public boolean runCompleted;
public WorkOrder() { public WorkOrder() {

Loading…
Cancel
Save