// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . // ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // Magicbane Emulator Project © 2013 - 2022 // www.magicbane.com package engine.loot; import engine.objects.NPC; import org.jetbrains.annotations.NotNull; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; import static java.lang.Math.toIntExact; public class WorkOrder implements Delayed { public int workOrderID; public NPC vendor; public int slotCount; public int itemCount; public int templateID; public String itemName; public int prefixToken; public int suffixToken; public boolean isRandom; public long completionTime; public boolean runCompleted; public WorkOrder() { } @Override public long getDelay(TimeUnit unit) { long timeRemaining = completionTime - System.currentTimeMillis(); return unit.convert(timeRemaining, TimeUnit.MILLISECONDS); } @Override public int compareTo(@NotNull Delayed o) { return toIntExact(this.completionTime - ((WorkOrder) o).completionTime); } }