From e02dbd363240054a4cecefd305280cc0c81ab7c5 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 15 Apr 2024 21:36:03 -0500 Subject: [PATCH] Universal Mines --- src/engine/objects/Mine.java | 3 ++- src/engine/objects/MineProduction.java | 28 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index dbd29bc4..ecdd54c6 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -71,7 +71,8 @@ public class Mine extends AbstractGameObject { public Mine(ResultSet rs) throws SQLException, UnknownHostException { 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"); this.buildingID = rs.getInt("mine_buildingUID"); diff --git a/src/engine/objects/MineProduction.java b/src/engine/objects/MineProduction.java index 0aac80a0..c7199bb3 100644 --- a/src/engine/objects/MineProduction.java +++ b/src/engine/objects/MineProduction.java @@ -16,7 +16,8 @@ public enum MineProduction { LUMBER("Lumber Camp", new HashMap<>(), Resource.WORMWOOD, 1618637196, 1663491950), ORE("Ore Mine", new HashMap<>(), Resource.OBSIDIAN, 518103023, -788976428), 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 HashMap resources; @@ -33,6 +34,7 @@ public enum MineProduction { } public static void addResources() { + if (MineProduction.LUMBER.resources.size() == 0) { MineProduction.LUMBER.resources.put(7, Resource.GOLD); 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(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) {