|
|
@ -64,11 +64,21 @@ public enum ForgeManager implements Runnable { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void start() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread messageDispatcher; |
|
|
|
|
|
|
|
messageDispatcher = new Thread(FORGE_MANAGER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
messageDispatcher.setName("Forge Manager"); |
|
|
|
|
|
|
|
messageDispatcher.start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void submit(WorkOrder workOrder) { |
|
|
|
public static void submit(WorkOrder workOrder) { |
|
|
|
workOrder.workOrderID = wordOrderCounter.incrementAndGet(); |
|
|
|
workOrder.workOrderID = wordOrderCounter.incrementAndGet(); |
|
|
|
workOrder.completionTime = System.currentTimeMillis() + 10000; |
|
|
|
workOrder.completionTime = System.currentTimeMillis() + 10000; |
|
|
|
|
|
|
|
|
|
|
|
// 0 signifies single item roll. > 0 signifies multiple item roll.
|
|
|
|
// 0 signifies single item roll. > 0 signifies multiple item roll.
|
|
|
|
|
|
|
|
|
|
|
|
workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce); |
|
|
|
workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce); |
|
|
|
|
|
|
|
|
|
|
|
workOrders.add(workOrder); |
|
|
|
workOrders.add(workOrder); |
|
|
|