Browse Source

Track items and their workorders.

combat-2
MagicBot 7 months ago
parent
commit
652476fde8
  1. 3
      src/engine/gameManager/ForgeManager.java
  2. 2
      src/engine/objects/NPC.java

3
src/engine/gameManager/ForgeManager.java

@ -49,6 +49,8 @@ public enum ForgeManager implements Runnable { @@ -49,6 +49,8 @@ public enum ForgeManager implements Runnable {
if (workOrder.total_to_produce == 0) {
workOrder.runCompleted = true;
workOrder.vendor.workOrders.remove(workOrder);
Logger.info("Workorder has completed: " + workOrder.workOrderID);
// Remove this workOrder from any slots on vendor
@ -85,6 +87,7 @@ public enum ForgeManager implements Runnable { @@ -85,6 +87,7 @@ public enum ForgeManager implements Runnable {
workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce);
workOrder.vendor.workOrders.add(workOrder);
workOrders.add(workOrder);
}

2
src/engine/objects/NPC.java

@ -79,7 +79,7 @@ public class NPC extends AbstractCharacter { @@ -79,7 +79,7 @@ public class NPC extends AbstractCharacter {
public int parentZoneUUID;
public int equipmentSetID = 0;
private int repairCost = 5;
ArrayList<WorkOrder> workOrders = new ArrayList<>();
public ArrayList<WorkOrder> workOrders = new ArrayList<>();
// New NPC constructor. Fill in the blanks and then call
// PERSIST.

Loading…
Cancel
Save