From f03edf5c5d6aa2387cb056a7a01c82b3e1f90717 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 25 Apr 2024 19:57:56 -0400 Subject: [PATCH] comment cleanup --- src/engine/gameManager/ForgeManager.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 95de5453..14468084 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -31,9 +31,9 @@ public enum ForgeManager implements Runnable { // MB Dev notes: // Class handles all forge rolling mechanics for the game. // - // WorkOrders may be submitted from any thread: usually (ItemProductionMsgHandler) - // as concurrency is managed by the same lock used by the warehouse (city.cityTransactionLock) - // WorkOrders are persisted then reconstituted at bootstrap from table dyn.workorders + // WorkOrders may be submitted from any thread: usually (ItemProductionMsgHandler). + // Concurrency is managed by the same lock used by the warehouse (city.cityTransactionLock). + // WorkOrders are persisted then reconstituted at bootstrap from table dyn.workorders. // // p.s. replaces garbage code that looked like it was written by a crack head with face boils. @@ -53,10 +53,7 @@ public enum ForgeManager implements Runnable { while (true) { // .forge is a delayQueue (blocking priority queue using an epoc sort) - // workOrders are popped and processed when their completion time has passed. - // - // workOrders can be enqueued from any thread such as from a db handler - // however the game's interface should always be .submit(workOrder). + // workOrders are popped and processed when their completion time has passed.. try { workOrder = forge.take(); @@ -209,7 +206,7 @@ public enum ForgeManager implements Runnable { int availableSlots = workOrder.vendor.getRank(); - // Subtract slots currently assigned to npc workOrders + // Subtract the slots currently assigned to other workOrders for this vendor for (WorkOrder npcWorkOrder : ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor)) availableSlots = availableSlots - npcWorkOrder.cooking.size(); @@ -224,7 +221,7 @@ public enum ForgeManager implements Runnable { public static HashMap calcProductionCost(WorkOrder workOrder) { - // Calculate production cost for a single run of this workOrder + // Calculate production cost for a single run of the workOrder HashMap production_cost = new HashMap<>(); ItemTemplate template = ItemTemplate.templates.get(workOrder.templateID); @@ -363,7 +360,7 @@ public enum ForgeManager implements Runnable { workOrder.total_produced = workOrder.total_produced + 1; } - // Save updated state to disk + // Write updated workOrder to disk DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder);