More WorkOrder work

This commit is contained in:
2024-04-08 13:06:22 -04:00
parent 0645a93b9c
commit f088d2aa72
2 changed files with 15 additions and 4 deletions
+12 -2
View File
@@ -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;
}
}
+3 -2
View File
@@ -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<>();