|
|
@ -128,8 +128,8 @@ public enum ForgeManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
int validation_result = WorkOrder.validate(workOrder); |
|
|
|
int validation_result = WorkOrder.validate(workOrder); |
|
|
|
|
|
|
|
|
|
|
|
// The return code is used by the ItemProductionMsgHandler as a
|
|
|
|
// The return code is used by the caller (ItemProductionMsgHandler)
|
|
|
|
// popup error message for the player.
|
|
|
|
// for display of a popup error message to the player.
|
|
|
|
|
|
|
|
|
|
|
|
if (validation_result != 0) |
|
|
|
if (validation_result != 0) |
|
|
|
return validation_result; |
|
|
|
return validation_result; |
|
|
@ -149,7 +149,7 @@ public enum ForgeManager implements Runnable { |
|
|
|
if (!workOrder.multiple_slot_request && workOrder.total_to_produce == 0) |
|
|
|
if (!workOrder.multiple_slot_request && workOrder.total_to_produce == 0) |
|
|
|
workOrder.total_to_produce = 1; |
|
|
|
workOrder.total_to_produce = 1; |
|
|
|
|
|
|
|
|
|
|
|
// Set total cost for this production run
|
|
|
|
// Set total cost for production run
|
|
|
|
|
|
|
|
|
|
|
|
workOrder.total_to_produce *= workOrder.slots_used; |
|
|
|
workOrder.total_to_produce *= workOrder.slots_used; |
|
|
|
|
|
|
|
|
|
|
@ -157,7 +157,7 @@ public enum ForgeManager implements Runnable { |
|
|
|
workOrder.production_cost_total.putAll(workOrder.production_cost); |
|
|
|
workOrder.production_cost_total.putAll(workOrder.production_cost); |
|
|
|
workOrder.production_cost_total.forEach((key, value) -> workOrder.production_cost_total.put(key, value * workOrder.total_to_produce)); |
|
|
|
workOrder.production_cost_total.forEach((key, value) -> workOrder.production_cost_total.put(key, value * workOrder.total_to_produce)); |
|
|
|
|
|
|
|
|
|
|
|
// Withdraw gold and resource costs
|
|
|
|
// Withdraw gold and resource costs. Availability has previously been validated.
|
|
|
|
|
|
|
|
|
|
|
|
if (!WorkOrder.withdrawWorkOrderCost(workOrder)) |
|
|
|
if (!WorkOrder.withdrawWorkOrderCost(workOrder)) |
|
|
|
return 58; //58: The formula is beyond the means of this facility
|
|
|
|
return 58; //58: The formula is beyond the means of this facility
|
|
|
@ -166,8 +166,8 @@ public enum ForgeManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
forgeWorkOrderBatch(workOrder); |
|
|
|
forgeWorkOrderBatch(workOrder); |
|
|
|
|
|
|
|
|
|
|
|
// Enqueue workOrder for next completion cycle
|
|
|
|
// Enqueue workOrder in the .forge and then
|
|
|
|
// and assign it to the vendor
|
|
|
|
// add the workOrder to it's vendor
|
|
|
|
|
|
|
|
|
|
|
|
vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder); |
|
|
|
vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder); |
|
|
|
forge.add(workOrder); |
|
|
|
forge.add(workOrder); |
|
|
|