Browse Source

Begin constructor refactor

combat-2
MagicBot 9 months ago
parent
commit
22326802b3
  1. 15
      src/engine/objects/Item.java

15
src/engine/objects/Item.java

@ -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,

Loading…
Cancel
Save