Browse Source

More WorkOrder work

combat-2
MagicBot 7 months ago
parent
commit
f088d2aa72
  1. 14
      src/engine/gameManager/ForgeManager.java
  2. 5
      src/engine/loot/WorkOrder.java

14
src/engine/gameManager/ForgeManager.java

@ -46,13 +46,13 @@ public enum ForgeManager implements Runnable { @@ -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 { @@ -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;
}
}

5
src/engine/loot/WorkOrder.java

@ -24,14 +24,15 @@ public class WorkOrder implements Delayed { @@ -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<Item> cooking = new ArrayList<>();

Loading…
Cancel
Save