forked from MagicBane/Server
refactored out dependency
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -17,6 +16,7 @@ import org.pmw.tinylog.Logger;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class Contract extends AbstractGameObject {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Contract extends AbstractGameObject {
|
||||
private ArrayList<Integer> npcModSuffixTable = new ArrayList<>();
|
||||
private ArrayList<Byte> itemModTable = new ArrayList<>();
|
||||
private ArrayList<Item> sellInventory = new ArrayList<>();
|
||||
private EnumBitSet<mbEnums.BuildingGroup> allowedBuildings;
|
||||
private EnumSet<mbEnums.BuildingGroup> allowedBuildings;
|
||||
private ArrayList<Integer> buyItemType = new ArrayList<>();
|
||||
private ArrayList<Integer> buySkillToken = new ArrayList<>();
|
||||
private ArrayList<Integer> buyUnknownToken = new ArrayList<>();
|
||||
@@ -85,7 +85,7 @@ public class Contract extends AbstractGameObject {
|
||||
this.vendorDialog = VendorDialog.getVendorDialog(rs.getInt("dialogID"));
|
||||
this.iconID = rs.getInt("iconID");
|
||||
this.vendorID = rs.getInt("vendorID");
|
||||
this.allowedBuildings = EnumBitSet.asEnumBitSet(rs.getLong("allowedBuildingTypeID"), mbEnums.BuildingGroup.class);
|
||||
this.allowedBuildings = mbEnums.fromLong(rs.getLong("allowedBuildingTypeID"), mbEnums.BuildingGroup.class);
|
||||
this.equipmentSet = rs.getInt("equipSetID");
|
||||
this.inventorySet = rs.getInt("inventorySet");
|
||||
|
||||
@@ -220,7 +220,7 @@ public class Contract extends AbstractGameObject {
|
||||
DbManager.ContractQueries.updateDatabase(this);
|
||||
}
|
||||
|
||||
public EnumBitSet<mbEnums.BuildingGroup> getAllowedBuildings() {
|
||||
public EnumSet<mbEnums.BuildingGroup> getAllowedBuildings() {
|
||||
return allowedBuildings;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public class Contract extends AbstractGameObject {
|
||||
return false;
|
||||
|
||||
// Binary match
|
||||
return (building.getBlueprint().getBuildingGroup().elementOf(this.allowedBuildings));
|
||||
return (this.allowedBuildings.contains(building.getBlueprint().getBuildingGroup()));
|
||||
}
|
||||
|
||||
public int getEquipmentSet() {
|
||||
|
||||
Reference in New Issue
Block a user