Browse Source

Universal Mines

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
e02dbd3632
  1. 3
      src/engine/objects/Mine.java
  2. 28
      src/engine/objects/MineProduction.java

3
src/engine/objects/Mine.java

@ -71,7 +71,8 @@ public class Mine extends AbstractGameObject {
public Mine(ResultSet rs) throws SQLException, UnknownHostException { public Mine(ResultSet rs) throws SQLException, UnknownHostException {
super(rs); super(rs);
this.mineType = MineProduction.getByName(rs.getString("mine_type")); //this.mineType = MineProduction.getByName(rs.getString("mine_type"));
this.mineType = MineProduction.ALL;
int ownerUID = rs.getInt("mine_ownerUID"); int ownerUID = rs.getInt("mine_ownerUID");
this.buildingID = rs.getInt("mine_buildingUID"); this.buildingID = rs.getInt("mine_buildingUID");

28
src/engine/objects/MineProduction.java

@ -16,7 +16,8 @@ public enum MineProduction {
LUMBER("Lumber Camp", new HashMap<>(), Resource.WORMWOOD, 1618637196, 1663491950), LUMBER("Lumber Camp", new HashMap<>(), Resource.WORMWOOD, 1618637196, 1663491950),
ORE("Ore Mine", new HashMap<>(), Resource.OBSIDIAN, 518103023, -788976428), ORE("Ore Mine", new HashMap<>(), Resource.OBSIDIAN, 518103023, -788976428),
GOLD("Gold Mine", new HashMap<>(), Resource.GALVOR, -662193002, -1227205358), GOLD("Gold Mine", new HashMap<>(), Resource.GALVOR, -662193002, -1227205358),
MAGIC("Magic Mine", new HashMap<>(), Resource.BLOODSTONE, 504746863, -1753567069); MAGIC("Magic Mine", new HashMap<>(), Resource.BLOODSTONE, 504746863, -1753567069),
ALL("Universal Mine",new HashMap<>(),null,504746864,504746865);
public final String name; public final String name;
public final HashMap<Integer, Resource> resources; public final HashMap<Integer, Resource> resources;
@ -33,6 +34,7 @@ public enum MineProduction {
} }
public static void addResources() { public static void addResources() {
if (MineProduction.LUMBER.resources.size() == 0) { if (MineProduction.LUMBER.resources.size() == 0) {
MineProduction.LUMBER.resources.put(7, Resource.GOLD); MineProduction.LUMBER.resources.put(7, Resource.GOLD);
MineProduction.LUMBER.resources.put(1580004, Resource.LUMBER); MineProduction.LUMBER.resources.put(1580004, Resource.LUMBER);
@ -63,6 +65,30 @@ public enum MineProduction {
MineProduction.MAGIC.resources.put(1580015, Resource.SULFUR); MineProduction.MAGIC.resources.put(1580015, Resource.SULFUR);
MineProduction.MAGIC.resources.put(1580016, Resource.QUICKSILVER); MineProduction.MAGIC.resources.put(1580016, Resource.QUICKSILVER);
} }
if (MineProduction.ALL.resources.size() == 0) {
MineProduction.ALL.resources.put(7, Resource.GOLD);
MineProduction.ALL.resources.put(1580004, Resource.LUMBER);
MineProduction.ALL.resources.put(1580005, Resource.OAK);
MineProduction.ALL.resources.put(1580006, Resource.BRONZEWOOD);
MineProduction.ALL.resources.put(1580007, Resource.MANDRAKE);
MineProduction.ALL.resources.put(1580012, Resource.AZOTH);
MineProduction.ALL.resources.put(1580013, Resource.ORICHALK);
MineProduction.ALL.resources.put(1580014, Resource.ANTIMONY);
MineProduction.ALL.resources.put(1580015, Resource.SULFUR);
MineProduction.ALL.resources.put(1580016, Resource.QUICKSILVER);
MineProduction.ALL.resources.put(1580000, Resource.STONE);
MineProduction.ALL.resources.put(1580008, Resource.COAL);
MineProduction.ALL.resources.put(1580009, Resource.AGATE);
MineProduction.ALL.resources.put(1580010, Resource.DIAMOND);
MineProduction.ALL.resources.put(1580011, Resource.ONYX);
MineProduction.ALL.resources.put(1580001, Resource.TRUESTEEL);
MineProduction.ALL.resources.put(1580002, Resource.IRON);
MineProduction.ALL.resources.put(1580003, Resource.ADAMANT);
MineProduction.ALL.resources.put(1580018, Resource.WORMWOOD);
MineProduction.ALL.resources.put(1580020, Resource.BLOODSTONE);
MineProduction.ALL.resources.put(1580019, Resource.OBSIDIAN);
MineProduction.ALL.resources.put(1580017, Resource.GALVOR);
}
} }
public static MineProduction getByName(String name) { public static MineProduction getByName(String name) {

Loading…
Cancel
Save