Renamed class to not conflict with the java.lang version.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public enum ItemManager {
|
||||
ITEMMANAGER;
|
||||
|
||||
public static Boolean ValidRace(Item item, Enum.MonsterType race) {
|
||||
public static Boolean ValidRace(Item item, mbEnums.MonsterType race) {
|
||||
|
||||
if (item.template.item_race_req.isEmpty() && item.template.item_race_res.isEmpty())
|
||||
return true;
|
||||
@@ -33,7 +33,7 @@ public enum ItemManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Boolean ValidClass(Item item, Enum.ClassType base, Enum.ClassType profession) {
|
||||
public static Boolean ValidClass(Item item, mbEnums.ClassType base, mbEnums.ClassType profession) {
|
||||
|
||||
// Early exit if no entry
|
||||
|
||||
@@ -51,14 +51,14 @@ public enum ItemManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Boolean ValidDiscipline(Item item, EnumSet<Enum.DisciplineType> discs) {
|
||||
public static Boolean ValidDiscipline(Item item, EnumSet<mbEnums.DisciplineType> discs) {
|
||||
|
||||
// Early exit if no entry
|
||||
|
||||
if (item.template.item_disc_req.isEmpty() && item.template.item_disc_res.isEmpty())
|
||||
return true;
|
||||
|
||||
EnumSet<Enum.DisciplineType> workSet = EnumSet.copyOf(discs);
|
||||
EnumSet<mbEnums.DisciplineType> workSet = EnumSet.copyOf(discs);
|
||||
|
||||
if (item.template.item_disc_req.isEmpty() == false) {
|
||||
|
||||
@@ -108,18 +108,18 @@ public enum ItemManager {
|
||||
|
||||
public static boolean isTwoHanded(Item item) {
|
||||
|
||||
if (!item.template.item_type.equals(Enum.ItemType.WEAPON))
|
||||
if (!item.template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
return false;
|
||||
|
||||
return item.template.item_eq_slots_and.contains(EnumSet.of(Enum.EquipSlotType.LHELD, Enum.EquipSlotType.RHELD));
|
||||
return item.template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
|
||||
}
|
||||
|
||||
public static boolean isTwoHanded(ItemTemplate template) {
|
||||
|
||||
if (!template.item_type.equals(Enum.ItemType.WEAPON))
|
||||
if (!template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
return false;
|
||||
|
||||
return template.item_eq_slots_and.contains(EnumSet.of(Enum.EquipSlotType.LHELD, Enum.EquipSlotType.RHELD));
|
||||
return template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
|
||||
}
|
||||
|
||||
public static boolean isShield(Item item) {
|
||||
@@ -138,7 +138,7 @@ public enum ItemManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean validForSlot(Enum.EquipSlotType slot, ConcurrentHashMap<Enum.EquipSlotType, Item> equipped, Item item) {
|
||||
public static boolean validForSlot(mbEnums.EquipSlotType slot, ConcurrentHashMap<mbEnums.EquipSlotType, Item> equipped, Item item) {
|
||||
|
||||
boolean validSlot = false;
|
||||
|
||||
@@ -157,18 +157,18 @@ public enum ItemManager {
|
||||
// Two handed weapons take up two slots
|
||||
|
||||
if ((isTwoHanded(item)) &&
|
||||
((slot == Enum.EquipSlotType.LHELD && equipped.get(Enum.EquipSlotType.RHELD) != null) ||
|
||||
(slot == Enum.EquipSlotType.RHELD && equipped.get(Enum.EquipSlotType.LHELD) != null)))
|
||||
((slot == mbEnums.EquipSlotType.LHELD && equipped.get(mbEnums.EquipSlotType.RHELD) != null) ||
|
||||
(slot == mbEnums.EquipSlotType.RHELD && equipped.get(mbEnums.EquipSlotType.LHELD) != null)))
|
||||
return false;
|
||||
|
||||
if (item.template.item_type.equals(Enum.ItemType.WEAPON))
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
if (equipped.get(slot) != null && equipped.get(slot).equals(item) == false)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean canEquip(Enum.EquipSlotType slot, CharacterItemManager itemManager, AbstractCharacter abstractCharacter, Item item) {
|
||||
public static boolean canEquip(mbEnums.EquipSlotType slot, CharacterItemManager itemManager, AbstractCharacter abstractCharacter, Item item) {
|
||||
|
||||
if (itemManager == null || abstractCharacter == null)
|
||||
return false;
|
||||
@@ -176,7 +176,7 @@ public enum ItemManager {
|
||||
// Early exit for mobiles and NPCS.
|
||||
// Perhaps not needed now that mobs have skills.
|
||||
|
||||
if (EnumSet.of(Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(abstractCharacter.getObjectType()))
|
||||
if (EnumSet.of(mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(abstractCharacter.getObjectType()))
|
||||
return false;
|
||||
|
||||
if (!validForSlot(slot, itemManager.getEquipped(), item))
|
||||
@@ -201,8 +201,8 @@ public enum ItemManager {
|
||||
Item item = new Item(templateID);
|
||||
|
||||
item.ownerID = reciever.getObjectUUID();
|
||||
item.ownerType = Enum.OwnerType.PlayerCharacter;
|
||||
item.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
item.ownerType = mbEnums.OwnerType.PlayerCharacter;
|
||||
item.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
item.numberOfItems = amount;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user