Browse Source

Configure upon submit()

combat-2
MagicBot 7 months ago
parent
commit
1429a3a4d5
  1. 9
      src/engine/gameManager/ForgeManager.java
  2. 3
      src/engine/loot/WorkOrder.java
  3. 1
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

9
src/engine/gameManager/ForgeManager.java

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
package engine.gameManager;
import engine.loot.WorkOrder;
import engine.mbEnums;
import engine.objects.Item;
import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger;
@ -88,6 +89,8 @@ public enum ForgeManager implements Runnable { @@ -88,6 +89,8 @@ public enum ForgeManager implements Runnable {
workOrder.workOrderID = wordOrderCounter.incrementAndGet();
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration;
workOrder.slotCount = calcAvailableSlots(workOrder);
workOrder.production_cost = calcProductionCost(workOrder);
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
// Single item rolls are total_to_produce of 0;
@ -144,4 +147,10 @@ public enum ForgeManager implements Runnable { @@ -144,4 +147,10 @@ public enum ForgeManager implements Runnable {
return availableSlots;
}
public static HashMap<mbEnums.ResourceType, Integer> calcProductionCost(WorkOrder workOrder) {
HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
return production_cost;
}
}

3
src/engine/loot/WorkOrder.java

@ -8,11 +8,13 @@ @@ -8,11 +8,13 @@
package engine.loot;
import engine.mbEnums;
import engine.objects.Item;
import engine.objects.NPC;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
@ -25,6 +27,7 @@ public class WorkOrder implements Delayed { @@ -25,6 +27,7 @@ public class WorkOrder implements Delayed {
public int slotCount;
public int total_to_produce;
public int total_produced;
public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
public int templateID;
public String itemName;
public int prefixToken;

1
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -86,7 +86,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -86,7 +86,6 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.prefixToken = msg.pToken;
workOrder.suffixToken = msg.sToken;
workOrder.itemName = msg.name;
workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder);
workOrder.slotCount = 0;
// Validate vendor can roll this item

Loading…
Cancel
Save