Begin constructor refactor

This commit is contained in:
2024-03-01 16:28:28 -05:00
parent 531662e012
commit 22326802b3
+12 -3
View File
@@ -39,8 +39,8 @@ import java.util.concurrent.locks.ReentrantLock;
public class Item extends AbstractWorldObject { public class Item extends AbstractWorldObject {
private static ConcurrentHashMap<String, Integer> enchantValues = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); private static ConcurrentHashMap<String, Integer> enchantValues = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final short durabilityMax; private short durabilityMax;
private final byte chargesMax; private byte chargesMax;
private final ConcurrentHashMap<AbstractEffectModifier, Float> bonuses = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); private final ConcurrentHashMap<AbstractEffectModifier, Float> bonuses = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final ArrayList<String> effectNames = new ArrayList<>(); private final ArrayList<String> effectNames = new ArrayList<>();
public Enum.ItemContainerType containerType; public Enum.ItemContainerType containerType;
@@ -62,10 +62,19 @@ public class Item extends AbstractWorldObject {
private long dateToUpgrade; private long dateToUpgrade;
private String customName = ""; private String customName = "";
private int magicValue; private int magicValue;
public ItemTemplate template;
public String name;
/** /**
* No Id Constructor * In Memory constructor
*/ */
public Item(int templateID) {
this.template = ItemTemplate.itemTemplates.get(templateID);
}
public Item(ItemBase itemBase, int ownerID, public Item(ItemBase itemBase, int ownerID,
OwnerType ownerType, byte chargesMax, byte chargesRemaining, OwnerType ownerType, byte chargesMax, byte chargesRemaining,
short durabilityCurrent, short durabilityMax, boolean canDestroy, short durabilityCurrent, short durabilityMax, boolean canDestroy,