|
|
@ -9,7 +9,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.objects; |
|
|
|
package engine.objects; |
|
|
|
|
|
|
|
|
|
|
|
import ch.claude_martin.enumbitset.EnumBitSet; |
|
|
|
|
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.mbEnums; |
|
|
|
import engine.mbEnums; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
@ -17,6 +16,7 @@ import org.pmw.tinylog.Logger; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.EnumSet; |
|
|
|
|
|
|
|
|
|
|
|
public class Contract extends AbstractGameObject { |
|
|
|
public class Contract extends AbstractGameObject { |
|
|
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ public class Contract extends AbstractGameObject { |
|
|
|
private ArrayList<Integer> npcModSuffixTable = new ArrayList<>(); |
|
|
|
private ArrayList<Integer> npcModSuffixTable = new ArrayList<>(); |
|
|
|
private ArrayList<Byte> itemModTable = new ArrayList<>(); |
|
|
|
private ArrayList<Byte> itemModTable = new ArrayList<>(); |
|
|
|
private ArrayList<Item> sellInventory = 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> buyItemType = new ArrayList<>(); |
|
|
|
private ArrayList<Integer> buySkillToken = new ArrayList<>(); |
|
|
|
private ArrayList<Integer> buySkillToken = new ArrayList<>(); |
|
|
|
private ArrayList<Integer> buyUnknownToken = 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.vendorDialog = VendorDialog.getVendorDialog(rs.getInt("dialogID")); |
|
|
|
this.iconID = rs.getInt("iconID"); |
|
|
|
this.iconID = rs.getInt("iconID"); |
|
|
|
this.vendorID = rs.getInt("vendorID"); |
|
|
|
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.equipmentSet = rs.getInt("equipSetID"); |
|
|
|
this.inventorySet = rs.getInt("inventorySet"); |
|
|
|
this.inventorySet = rs.getInt("inventorySet"); |
|
|
|
|
|
|
|
|
|
|
@ -220,7 +220,7 @@ public class Contract extends AbstractGameObject { |
|
|
|
DbManager.ContractQueries.updateDatabase(this); |
|
|
|
DbManager.ContractQueries.updateDatabase(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public EnumBitSet<mbEnums.BuildingGroup> getAllowedBuildings() { |
|
|
|
public EnumSet<mbEnums.BuildingGroup> getAllowedBuildings() { |
|
|
|
return allowedBuildings; |
|
|
|
return allowedBuildings; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -251,7 +251,7 @@ public class Contract extends AbstractGameObject { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// Binary match
|
|
|
|
// Binary match
|
|
|
|
return (building.getBlueprint().getBuildingGroup().elementOf(this.allowedBuildings)); |
|
|
|
return (this.allowedBuildings.contains(building.getBlueprint().getBuildingGroup())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getEquipmentSet() { |
|
|
|
public int getEquipmentSet() { |
|
|
|