Contextual variable name updates

This commit is contained in:
2024-04-13 07:54:26 -04:00
parent 68f2af5306
commit f076b38044
3 changed files with 12 additions and 12 deletions
+6 -6
View File
@@ -47,7 +47,7 @@ public enum ForgeManager implements Runnable {
// Create negative ID items to add to collections
for (int i = 0; i < workOrder.slotCount; ++i) {
for (int i = 0; i < workOrder.slots_used; ++i) {
// Create workOrder items; one for each slot
// assigned to this workOrder.
@@ -100,7 +100,7 @@ public enum ForgeManager implements Runnable {
workOrder.workOrderID = wordOrderCounter.incrementAndGet();
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration;
workOrder.slotCount = calcAvailableSlots(workOrder);
workOrder.slots_used = calcAvailableSlots(workOrder);
// Cost to execute this workOrder
@@ -113,12 +113,12 @@ public enum ForgeManager implements Runnable {
// Single item rolls are total_to_produce of 0;
if (workOrder.slotCount > 0 && workOrder.total_to_produce == 0)
workOrder.slotCount = 1;
if (workOrder.slots_used > 0 && workOrder.total_to_produce == 0)
workOrder.slots_used = 1;
// Create negative ID items to add to collections
for (int i = 0; i < workOrder.slotCount; ++i) {
for (int i = 0; i < workOrder.slots_used; ++i) {
// Create workOrder items; one for each slot
// assigned to this workOrder.
@@ -194,7 +194,7 @@ public enum ForgeManager implements Runnable {
// Slots currently used up by the npc workOrders
for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders)
availableSlots = availableSlots - npcWorkOrder.slotCount;
availableSlots = availableSlots - npcWorkOrder.slots_used;
// Slot count override for single item production
+4 -4
View File
@@ -25,13 +25,13 @@ public class WorkOrder implements Delayed {
public int workOrderID;
public NPC vendor;
public int slotCount;
public int slots_used;
public int total_to_produce;
public int total_produced;
public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
public HashMap<mbEnums.ResourceType, Integer> production_cost_total = new HashMap<>();
public int templateID;
public String itemName;
public String item_name_override;
public int prefixToken;
public int suffixToken;
public long rollingDuration;
@@ -66,11 +66,11 @@ public class WorkOrder implements Delayed {
String outSTring = "\r\nwordOrderID: " + this.workOrderID + "\r\n" +
"vendor: " + this.vendor.getObjectUUID() + "\r\n" +
"slotCount: " + this.slotCount + "\r\n" +
"slots_used: " + this.slots_used + "\r\n" +
"total_to_produce: " + this.total_to_produce + "\r\n" +
"total_produced: " + this.total_produced + "\r\n" +
"templateID: " + this.templateID + "\r\n" +
"itemName: " + this.itemName + "\r\n" +
"item_name_override: " + this.item_name_override + "\r\n" +
"prefixToken: " + this.prefixToken + "\r\n" +
"suffixToken: " + this.suffixToken + "\r\n" +
"rollingDuration: " + duration + "\r\n" +
@@ -85,8 +85,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.templateID = msg.templateID;
workOrder.prefixToken = msg.pToken;
workOrder.suffixToken = msg.sToken;
workOrder.itemName = msg.name;
workOrder.slotCount = 0;
workOrder.item_name_override = msg.name;
workOrder.slots_used = 0;
// Validate vendor can roll this item