From f076b380447654d61cdfd52d790c51761edc7c2a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 13 Apr 2024 07:54:26 -0400 Subject: [PATCH] Contextual variable name updates --- src/engine/gameManager/ForgeManager.java | 12 ++++++------ src/engine/loot/WorkOrder.java | 8 ++++---- .../client/handlers/ItemProductionMsgHandler.java | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 36133d7b..6499ce59 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -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 diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index d1b0903f..d301df3d 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -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 production_cost = new HashMap<>(); public HashMap 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" + diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 953ff486..67cbf5b7 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -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