Configure upon submit()
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
package engine.gameManager;
|
package engine.gameManager;
|
||||||
|
|
||||||
import engine.loot.WorkOrder;
|
import engine.loot.WorkOrder;
|
||||||
|
import engine.mbEnums;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
@@ -88,6 +89,8 @@ public enum ForgeManager implements Runnable {
|
|||||||
workOrder.workOrderID = wordOrderCounter.incrementAndGet();
|
workOrder.workOrderID = wordOrderCounter.incrementAndGet();
|
||||||
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration;
|
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration;
|
||||||
workOrder.slotCount = calcAvailableSlots(workOrder);
|
workOrder.slotCount = calcAvailableSlots(workOrder);
|
||||||
|
workOrder.production_cost = calcProductionCost(workOrder);
|
||||||
|
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
|
||||||
|
|
||||||
// Single item rolls are total_to_produce of 0;
|
// Single item rolls are total_to_produce of 0;
|
||||||
|
|
||||||
@@ -144,4 +147,10 @@ public enum ForgeManager implements Runnable {
|
|||||||
|
|
||||||
return availableSlots;
|
return availableSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HashMap<mbEnums.ResourceType, Integer> calcProductionCost(WorkOrder workOrder) {
|
||||||
|
HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
|
||||||
|
|
||||||
|
return production_cost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
|
|
||||||
package engine.loot;
|
package engine.loot;
|
||||||
|
|
||||||
|
import engine.mbEnums;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.objects.NPC;
|
import engine.objects.NPC;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.Delayed;
|
import java.util.concurrent.Delayed;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -25,6 +27,7 @@ public class WorkOrder implements Delayed {
|
|||||||
public int slotCount;
|
public int slotCount;
|
||||||
public int total_to_produce;
|
public int total_to_produce;
|
||||||
public int total_produced;
|
public int total_produced;
|
||||||
|
public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
|
||||||
public int templateID;
|
public int templateID;
|
||||||
public String itemName;
|
public String itemName;
|
||||||
public int prefixToken;
|
public int prefixToken;
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
workOrder.prefixToken = msg.pToken;
|
workOrder.prefixToken = msg.pToken;
|
||||||
workOrder.suffixToken = msg.sToken;
|
workOrder.suffixToken = msg.sToken;
|
||||||
workOrder.itemName = msg.name;
|
workOrder.itemName = msg.name;
|
||||||
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
|
|
||||||
workOrder.slotCount = 0;
|
workOrder.slotCount = 0;
|
||||||
|
|
||||||
// Validate vendor can roll this item
|
// Validate vendor can roll this item
|
||||||
|
|||||||
Reference in New Issue
Block a user