diff --git a/src/main/java/satisfactory/Database.java b/src/main/java/satisfactory/Database.java index 4d7bc30..b72c8f7 100644 --- a/src/main/java/satisfactory/Database.java +++ b/src/main/java/satisfactory/Database.java @@ -1,6 +1,8 @@ package satisfactory; -import satisfactory.buildings.production.*; +import satisfactory.buildings.Building; +import satisfactory.buildings.ProductionBuilding; +import satisfactory.buildings.PowerGenerationBuilding; import satisfactory.items.Item; import satisfactory.items.Recipe; import satisfactory.items.type.*; @@ -8,6 +10,218 @@ import satisfactory.items.type.*; import java.util.*; public class Database { + // BUILDINGS + public static final class Buildings { + public static final Building ASSEMBLER = new ProductionBuilding("Assembler", 15, assembler()); + public static final Building BLENDER = new ProductionBuilding("Blender", -9999, blender()); // FIXME values + public static final Building CONSTRUCTOR = new ProductionBuilding("Constructor", 4, constructor()); + public static final Building CRAFT_BENCH = new ProductionBuilding("Craft Bench", 0, craftBench()); + public static final Building EQUIPMENT_WORKSHOP = new ProductionBuilding("Equipment Workshop", 0, equipmentWorkshop()); + public static final Building FOUNDRY = new ProductionBuilding("Foundry", 16, foundry()); + public static final Building MANUFACTURER = new ProductionBuilding("Manufacturer", 55, manufacturer()); + public static final Building MINER_MK1 = new ProductionBuilding("Miner Mk1", 5, minerMk1()); + public static final Building MINER_MK2 = new ProductionBuilding("Miner Mk2", 12, minerMk2()); + public static final Building MINER_MK3 = new ProductionBuilding("Miner Mk3", -9999, minerMk3()); // FIXME values + public static final Building OIL_EXTRACTOR = new ProductionBuilding("Oil Extractor", 40, oilExtractor()); + public static final Building PACKAGER = new ProductionBuilding("Packager", 10, packager()); + public static final Building REFINERY = new ProductionBuilding("Refinery", 30, refinery()); + public static final Building RESOURCE_WELL_EXTRACTOR = new ProductionBuilding("Resource Well Extractor", -9999, resourceWellExtractor()); // FIXME values // TODO: couple with Resource Well Pressurizer + public static final Building SMELTER = new ProductionBuilding("Smelter", 4, smelter()); + public static final Building WATER_EXTRACTOR = new ProductionBuilding("Water Extractor", 20, waterExtractor()); + + private static Map assembler() { + Map cost = new HashMap<>(); + cost.put(Database.ReinforcedIronPlate, 8); + cost.put(Database.Rotor, 4); + cost.put(Database.Cable, 10); + return cost; + } + + + private static Map blender() { + Map cost = new HashMap<>(); + cost.put(null, null); //FIXME values + return cost; + } + + + private static Map constructor() { + Map cost = new HashMap<>(); + cost.put(Database.ReinforcedIronPlate, 2); + cost.put(Database.Cable, 8); + return cost; + } + + + private static Map craftBench() { + Map cost = new HashMap<>(); + cost.put(Database.IronPlate, 3); + cost.put(Database.IronRod, 3); + return cost; + } + + + private static Map equipmentWorkshop() { + Map cost = new HashMap<>(); + cost.put(Database.IronPlate, 6); + cost.put(Database.IronRod, 4); + return cost; + } + + + private static Map foundry() { + Map cost = new HashMap<>(); + cost.put(Database.ModularFrame, 10); + cost.put(Database.Rotor, 10); + cost.put(Database.Concrete, 20); + return cost; + } + + + private static Map manufacturer() { + Map cost = new HashMap<>(); + cost.put(Database.Motor, 5); + cost.put(Database.HeavyModularFrame, 10); + cost.put(Database.Cable, 50); + cost.put(Database.Plastic, 50); + return cost; + } + + + private static Map minerMk1() { + Map cost = new HashMap<>(); + cost.put(Database.PortableMiner, 1); + cost.put(Database.IronPlate, 10); + cost.put(Database.Concrete, 10); + return cost; + } + + + private static Map minerMk2() { + Map cost = new HashMap<>(); + cost.put(Database.PortableMiner, 2); + cost.put(Database.EncasedIndustrialBeam, 10); + cost.put(Database.SteelPipe, 20); + cost.put(Database.ModularFrame, 10); + return cost; + } + + + private static Map minerMk3() { + Map cost = new HashMap<>(); + cost.put(Database.PortableMiner, 2); + cost.put(null, null); //FIXME values + return cost; + } + + + private static Map oilExtractor() { + Map cost = new HashMap<>(); + cost.put(Database.Motor, 15); + cost.put(Database.EncasedIndustrialBeam, 20); + cost.put(Database.Cable, 60); + return cost; + } + + + private static Map packager() { + Map cost = new HashMap<>(); + cost.put(Database.SteelBeam, 20); + cost.put(Database.Rubber, 10); + cost.put(Database.Plastic, 10); + return cost; + } + + + private static Map refinery() { + Map cost = new HashMap<>(); + cost.put(Database.Motor, 10); + cost.put(Database.EncasedIndustrialBeam, 10); + cost.put(Database.SteelPipe, 30); + cost.put(Database.CopperSheet, 20); + return cost; + } + + + private static Map resourceWellExtractor() { + Map cost = new HashMap<>(); + cost.put(null, null); // FIXME values + return cost; + } + + + private static Map smelter() { + Map cost = new HashMap<>(); + cost.put(Database.IronRod, 5); + cost.put(Database.Wire, 8); + return cost; + } + + + private static Map waterExtractor() { + Map cost = new HashMap<>(); + cost.put(Database.CopperSheet, 20); + cost.put(Database.ReinforcedIronPlate, 10); + cost.put(Database.Rotor, 10); + return cost; + } + + public static final Building BIOMASS_BURNER = new PowerGenerationBuilding("Biomass Burner", 30, biomassBurner(), biomassBurnerConsumes()); + public static final Building COAL_GENERATOR = new PowerGenerationBuilding("Coal Generator", 75, coalGenerator(),coalGeneratorConsumes()); + public static final Building FUEL_GENERATOR = new PowerGenerationBuilding("Fuel Generator", 150, fuelGenerator(), fuelGeneratorConsumes()); + public static final Building GEOTHERMAL_GENERATOR = new PowerGenerationBuilding("Geothermal Generator", 9999, geothermalGenerator(), new HashMap<>()); + private static Map biomassBurner() { + Map cost = new HashMap<>(); + cost.put(Database.IronPlate, 15); + cost.put(Database.IronRod, 15); + cost.put(Database.Wire, 25); + return cost; + } + private static Map biomassBurnerConsumes() { + Map cost = new HashMap<>(); + // TODO values usage/min + return cost; + } + private static Map coalGenerator() { + Map cost = new HashMap<>(); + cost.put(Database.ReinforcedIronPlate, 20); + cost.put(Database.Rotor, 10); + cost.put(Database.Cable, 30); + return cost; + } + private static Map coalGeneratorConsumes() { + Map cost = new HashMap<>(); + // TODO values usage/min + return cost; + } + private static Map fuelGenerator() { + Map cost = new HashMap<>(); + cost.put(Database.Computer, 5); + cost.put(Database.HeavyModularFrame, 10); + cost.put(Database.Motor, 15); + cost.put(Database.Rubber, 50); + cost.put(Database.Quickwire, 50); + return cost; + } + private static Map fuelGeneratorConsumes() { + Map cost = new HashMap<>(); + // TODO values usage/min + return cost; + } + private static Map geothermalGenerator() { + Map cost = new HashMap<>(); + cost.put(Database.SuperComputer, 8); + cost.put(Database.HeavyModularFrame, 16); + cost.put(Database.HighSpeedConnector, 16); + cost.put(Database.CopperSheet, 40); + cost.put(Database.Rubber, 80); + return cost; + } + + } + + // ITEMS + public static final Map preferences = new HashMap<>(); // Items & recipes public static final Item IronOre = new Ore("Iron Ore"); @@ -128,11 +342,11 @@ public class Database { Set ores = new HashSet<>(Arrays.asList(IronOre, Coal, Limestone, CopperOre, CateriumOre, Sulfur, Uranium)); ores.addAll(Arrays.asList(Bauxite, RawQuartz));// TODO: rly? for (Item ore : ores) { - Recipe mk1 = new Recipe(1, "Miner Mk1", false, MinerMk1.class); + Recipe mk1 = new Recipe(1, "Miner Mk1", false, Buildings.MINER_MK1); ore.add(mk1, 1); - Recipe mk2 = new Recipe(1, "Miner Mk2", false, MinerMk2.class); + Recipe mk2 = new Recipe(1, "Miner Mk2", false, Buildings.MINER_MK2); ore.add(mk2, 2); - //Recipe mk3 = new Recipe(1, "Miner Mk3", false, MinerMk3.class); + //Recipe mk3 = new Recipe(1, "Miner Mk3", false, MINER_MK2); //ore.add(mk3, 3); ore.setPreference(mk2); } @@ -140,19 +354,19 @@ public class Database { // fluids Set rawFluids = new HashSet<>(Arrays.asList(CrudeOil, Water)); // no common well yet - CrudeOil.add(new Recipe(1, "Oil extracting thingy", false, OilExtractor.class), 2); + CrudeOil.add(new Recipe(1, "Oil extracting thingy", false, Buildings.OIL_EXTRACTOR), 2); //CrudeOil.setPreference(); - Recipe water = new Recipe(1, "water pump thingy", false, WaterExtractor.class); + Recipe water = new Recipe(1, "water pump thingy", false, Buildings.WATER_EXTRACTOR); Water.add(water, 2); Water.setPreference(water); // gases - NitrogenGas.add(new Recipe(1, "pressure thingy", false, ResourceWellExtractor.class)); + NitrogenGas.add(new Recipe(1, "pressure thingy", false, Buildings.RESOURCE_WELL_EXTRACTOR)); } { // Iron Ingot - IronIngot.add(new Recipe(2, IronOre, 1, Smelter.class)); - Recipe alt = new Recipe(12, Refinery.class); + IronIngot.add(new Recipe(2, IronOre, 1, Buildings.SMELTER)); + Recipe alt = new Recipe(12, Buildings.REFINERY); alt.addInput(IronOre, 7); alt.addInput(Water, 4); alt.addOutput(IronIngot, 13); @@ -160,28 +374,28 @@ public class Database { } { // Copper Ingot - CopperIngot.add(new Recipe(2, CopperOre, 1, Smelter.class)); + CopperIngot.add(new Recipe(2, CopperOre, 1, Buildings.SMELTER)); } { // Caterium Ingot - CateriumIngot.add(new Recipe(4, CateriumOre, 3, Smelter.class)); + CateriumIngot.add(new Recipe(4, CateriumOre, 3, Buildings.SMELTER)); } { // Steel Ingot - Recipe recipe = new Recipe(4, Foundry.class); + Recipe recipe = new Recipe(4, Buildings.FOUNDRY); recipe.addInput(IronOre, 3); recipe.addInput(Coal, 3); SteelIngot.add(recipe, 3); } { // Concrete - Concrete.add(new Recipe(4, Limestone, 3, Constructor.class)); + Concrete.add(new Recipe(4, Limestone, 3, Buildings.CONSTRUCTOR)); } { // Iron Plate - Recipe recipe = new Recipe(6, IronIngot, 3, Constructor.class); + Recipe recipe = new Recipe(6, IronIngot, 3, Buildings.CONSTRUCTOR); IronPlate.add(recipe, 2); - Recipe steelCoated = new Recipe(24, "Steel Coated Plate", false, Assembler.class); + Recipe steelCoated = new Recipe(24, "Steel Coated Plate", false, Buildings.ASSEMBLER); steelCoated.addInput(SteelIngot, 3); steelCoated.addInput(Plastic, 2); IronPlate.add(steelCoated, 18); @@ -189,23 +403,23 @@ public class Database { } { // Iron Rod - IronRod.add(new Recipe(4, IronIngot, 1, Constructor.class)); + IronRod.add(new Recipe(4, IronIngot, 1, Buildings.CONSTRUCTOR)); } { // Screw - Screw.add(new Recipe(6, IronRod, 1, Constructor.class), 4); + Screw.add(new Recipe(6, IronRod, 1, Buildings.CONSTRUCTOR), 4); } { // Steel Beam - SteelBeam.add(new Recipe(4, SteelIngot, 4, Constructor.class)); + SteelBeam.add(new Recipe(4, SteelIngot, 4, Buildings.CONSTRUCTOR)); } { // Reinforced Iron Plate - Recipe recipe = new Recipe(12, Assembler.class); + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER); recipe.addInput(IronPlate, 6); recipe.addInput(Screw, 12); ReinforcedIronPlate.add(recipe); - Recipe bolted = new Recipe(4, "Bolted Iron Plate", false, Assembler.class); + Recipe bolted = new Recipe(4, "Bolted Iron Plate", false, Buildings.ASSEMBLER); bolted.addInput(IronPlate, 18); bolted.addInput(Screw, 50); ReinforcedIronPlate.add(bolted, 3); @@ -214,34 +428,34 @@ public class Database { } { // Modular Frame - Recipe recipe = new Recipe(60, Assembler.class); + Recipe recipe = new Recipe(60, Buildings.ASSEMBLER); recipe.addInput(ReinforcedIronPlate, 3); recipe.addInput(IronRod, 12); ModularFrame.add(recipe, 2); } { // Steel Pipe - Recipe recipe = new Recipe(6, Constructor.class); + Recipe recipe = new Recipe(6, Buildings.CONSTRUCTOR); recipe.addInput(SteelIngot, 3); SteelPipe.add(recipe, 2); } { // Encased Industrial Beam - Recipe recipe = new Recipe(10, Assembler.class); + Recipe recipe = new Recipe(10, Buildings.ASSEMBLER); recipe.addInput(SteelBeam, 4); recipe.addInput(Concrete, 5); EncasedIndustrialBeam.add(recipe); } { // Heavy Modular Frame - Recipe recipe = new Recipe(30, Manufacturer.class); + Recipe recipe = new Recipe(30, Buildings.MANUFACTURER); recipe.addInput(ModularFrame, 5); recipe.addInput(SteelPipe, 15); recipe.addInput(EncasedIndustrialBeam, 5); recipe.addInput(Screw, 100); HeavyModularFrame.add(recipe); HeavyModularFrame.setPreference(recipe); - Recipe heavyEncasedFrame = new Recipe(21, Manufacturer.class); + Recipe heavyEncasedFrame = new Recipe(21, Buildings.MANUFACTURER); // TODO: duration = 60/2.812 heavyEncasedFrame.addInput(ModularFrame, 8); heavyEncasedFrame.addInput(EncasedIndustrialBeam, 10); @@ -252,12 +466,12 @@ public class Database { } { // Wire - Wire.add(new Recipe(4, CopperIngot, 1, Constructor.class), 2); + Wire.add(new Recipe(4, CopperIngot, 1, Buildings.CONSTRUCTOR), 2); } { // Cable - Cable.add(new Recipe(2, Wire, 2, Constructor.class)); - Recipe quickWireCable = new Recipe(2, Assembler.class); + Cable.add(new Recipe(2, Wire, 2, Buildings.CONSTRUCTOR)); + Recipe quickWireCable = new Recipe(2, Buildings.ASSEMBLER); // TODO 60/27,5 quickWireCable.addInput(Quickwire, 3); quickWireCable.addInput(Rubber, 2); @@ -266,8 +480,8 @@ public class Database { } { // Copper Sheet - CopperSheet.add(new Recipe(6, CopperIngot, 2, Constructor.class)); - Recipe steamedCopperSheet = new Recipe(2, Refinery.class); + CopperSheet.add(new Recipe(6, CopperIngot, 2, Buildings.CONSTRUCTOR)); + Recipe steamedCopperSheet = new Recipe(2, Buildings.REFINERY); // TODO: duration = 60/22.5 steamedCopperSheet.addInput(CopperIngot, 3); steamedCopperSheet.addInput(Water, 3); @@ -277,16 +491,16 @@ public class Database { } { // Quickwire - Quickwire.add(new Recipe(5, CateriumIngot, 1, Constructor.class), 5); + Quickwire.add(new Recipe(5, CateriumIngot, 1, Buildings.CONSTRUCTOR), 5); } { // Circuit Board - Recipe recipe = new Recipe(8, Assembler.class); + Recipe recipe = new Recipe(8, Buildings.ASSEMBLER); recipe.addInput(CopperSheet, 2); recipe.addInput(Plastic, 4); CircuitBoard.add(recipe); // TODO: alternative - Recipe electrodeCircuitBoard = new Recipe(12, Assembler.class); + Recipe electrodeCircuitBoard = new Recipe(12, Buildings.ASSEMBLER); electrodeCircuitBoard.addInput(Rubber, 6); electrodeCircuitBoard.addInput(PetroleumCoke, 9); electrodeCircuitBoard.addOutput(CircuitBoard, 1); @@ -294,14 +508,14 @@ public class Database { } { // A.I. Limiter - Recipe recipe = new Recipe(12, Assembler.class); + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER); recipe.addInput(CopperSheet, 5); recipe.addInput(Quickwire, 20); AILimiter.add(recipe); } { // High Speed Connector - Recipe recipe = new Recipe(16, Manufacturer.class); + Recipe recipe = new Recipe(16, Buildings.MANUFACTURER); recipe.addInput(Quickwire, 56); recipe.addInput(Cable, 10); recipe.addInput(CircuitBoard, 1); @@ -309,48 +523,48 @@ public class Database { } { // Biomass - Biomass.add(new Recipe(5, Leaves, 10, Constructor.class), 5); // TODO CraftBench - Biomass.add(new Recipe(4, Wood, 4, Constructor.class), 20); // TODO CraftBench - Biomass.add(new Recipe(4, Mycelia, 1, Constructor.class), 10); // TODO CraftBench - Biomass.add(new Recipe(4, AlienProtein, 1, Constructor.class), 100); // TODO CraftBench + Biomass.add(new Recipe(5, Leaves, 10, Buildings.CONSTRUCTOR), 5); // TODO CraftBench + Biomass.add(new Recipe(4, Wood, 4, Buildings.CONSTRUCTOR), 20); // TODO CraftBench + Biomass.add(new Recipe(4, Mycelia, 1, Buildings.CONSTRUCTOR), 10); // TODO CraftBench + Biomass.add(new Recipe(4, AlienProtein, 1, Buildings.CONSTRUCTOR), 100); // TODO CraftBench } { // Alien Protein - AlienProtein.add(new Recipe(3, HogRemains, 1, Constructor.class)); // TODO CraftBench - AlienProtein.add(new Recipe(3, PlasmaSpitterRemains, 1, Constructor.class)); // TODO CraftBench - AlienProtein.add(new Recipe(3, StingerRemains, 1, Constructor.class)); // TODO CraftBench - AlienProtein.add(new Recipe(3, HatcherRemains, 1, Constructor.class)); // TODO CraftBench + AlienProtein.add(new Recipe(3, HogRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench + AlienProtein.add(new Recipe(3, PlasmaSpitterRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench + AlienProtein.add(new Recipe(3, StingerRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench + AlienProtein.add(new Recipe(3, HatcherRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench } { // Fabric - Recipe recipe = new Recipe(4, Assembler.class); + Recipe recipe = new Recipe(4, Buildings.ASSEMBLER); recipe.addInput(Mycelia); recipe.addInput(Biomass, 5); Fabric.add(recipe); - Recipe alt = new Recipe(2, Refinery.class); + Recipe alt = new Recipe(2, Buildings.REFINERY); recipe.addInput(PolymerResin, 1); recipe.addInput(Water, 1); recipe.addOutput(Fabric, 1); } { // Solid Biofuel - SolidBiofuel.add(new Recipe(4, Biomass, 8, Constructor.class), 4); + SolidBiofuel.add(new Recipe(4, Biomass, 8, Buildings.CONSTRUCTOR), 4); } { // Rotor - Recipe recipe = new Recipe(15, Assembler.class); + Recipe recipe = new Recipe(15, Buildings.ASSEMBLER); recipe.addInput(IronRod, 5); recipe.addInput(Screw, 25); Rotor.add(recipe); } { // Stator - Recipe recipe = new Recipe(12, Assembler.class); + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER); recipe.addInput(SteelPipe, 3); recipe.addInput(Wire, 8); Stator.add(recipe); Stator.setPreference(recipe); - Recipe quickwireStator = new Recipe(8, Assembler.class); + Recipe quickwireStator = new Recipe(8, Buildings.ASSEMBLER); //TODO 60/8 quickwireStator.addInput(SteelPipe, 4); quickwireStator.addInput(Quickwire, 15); @@ -359,31 +573,31 @@ public class Database { } { // Motor - Recipe recipe = new Recipe(12, Assembler.class); + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER); recipe.addInput(Rotor, 2); recipe.addInput(Stator, 2); Motor.add(recipe); } { // Power Shard - PowerShard.add(new Recipe(8, GreenPowerSlug, 1, Constructor.class)); - PowerShard.add(new Recipe(12, YellowPowerSlug, 1, Constructor.class), 2); - PowerShard.add(new Recipe(24, PurplePowerSlug, 1, Constructor.class), 5); + PowerShard.add(new Recipe(8, GreenPowerSlug, 1, Buildings.CONSTRUCTOR)); + PowerShard.add(new Recipe(12, YellowPowerSlug, 1, Buildings.CONSTRUCTOR), 2); + PowerShard.add(new Recipe(24, PurplePowerSlug, 1, Buildings.CONSTRUCTOR), 5); } { // Black Powder - Recipe recipe = new Recipe(8, Assembler.class); + Recipe recipe = new Recipe(8, Buildings.ASSEMBLER); recipe.addInput(Coal); recipe.addInput(Sulfur, 2); BlackPowder.add(recipe); } { // Color Catridge - ColorCatridge.add(new Recipe(6, FlowerPetals, 5, Constructor.class), 10); + ColorCatridge.add(new Recipe(6, FlowerPetals, 5, Buildings.CONSTRUCTOR), 10); } { // Gas Filter - Recipe recipe = new Recipe(8, Manufacturer.class); + Recipe recipe = new Recipe(8, Buildings.MANUFACTURER); recipe.addInput(Coal, 5); recipe.addInput(Rubber, 2); recipe.addInput(Fabric, 2); @@ -391,13 +605,13 @@ public class Database { } { // Computer - Recipe recipe = new Recipe(24, Manufacturer.class); + Recipe recipe = new Recipe(24, Buildings.MANUFACTURER); recipe.addInput(CircuitBoard, 10); recipe.addInput(Cable, 9); recipe.addInput(Plastic, 18); recipe.addInput(Screw, 52); Computer.add(recipe); - Recipe alternative = new Recipe(16, "Caterium Computer", false, Manufacturer.class); + Recipe alternative = new Recipe(16, "Caterium Computer", false, Buildings.MANUFACTURER); alternative.addInput(CircuitBoard, 7); alternative.addInput(Quickwire, 28); alternative.addInput(Rubber, 12); @@ -407,7 +621,7 @@ public class Database { } { // Super Computer - Recipe recipe = new Recipe(32, Manufacturer.class); + Recipe recipe = new Recipe(32, Buildings.MANUFACTURER); recipe.addInput(Computer, 2); recipe.addInput(AILimiter, 2); recipe.addInput(HighSpeedConnector, 3); @@ -416,11 +630,11 @@ public class Database { } { // Empty Canister - EmptyCanister.add(new Recipe(4, Plastic, 2, Constructor.class), 4); + EmptyCanister.add(new Recipe(4, Plastic, 2, Buildings.CONSTRUCTOR), 4); } { // Beacon - Recipe recipe = new Recipe(8, Manufacturer.class); + Recipe recipe = new Recipe(8, Buildings.MANUFACTURER); recipe.addInput(IronPlate, 3); recipe.addInput(IronRod); recipe.addInput(Wire, 15); @@ -429,7 +643,7 @@ public class Database { } { // Modular Engine - Recipe recipe = new Recipe(60, false, Manufacturer.class); + Recipe recipe = new Recipe(60, false, Buildings.MANUFACTURER); recipe.addInput(Motor, 2); recipe.addInput(Rubber, 15); recipe.addInput(SmartPlating, 2); @@ -437,7 +651,7 @@ public class Database { } { // Adaptive Control Unit - Recipe recipe = new Recipe(120, false, Manufacturer.class); + Recipe recipe = new Recipe(120, false, Buildings.MANUFACTURER); recipe.addInput(AutomatedWiring, 15); recipe.addInput(CircuitBoard, 10); recipe.addInput(HeavyModularFrame, 2); @@ -446,14 +660,14 @@ public class Database { } { // Nobelisk - Recipe recipe = new Recipe(20, false, Assembler.class); + Recipe recipe = new Recipe(20, false, Buildings.ASSEMBLER); recipe.addInput(BlackPowder, 5); recipe.addInput(SteelPipe, 10); Nobelisk.add(recipe); } { // Gas Nobelisk - Recipe recipe = new Recipe(12, Assembler.class); //TODO EquipmentWorkshop + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER); //TODO EquipmentWorkshop recipe.addInput(Nobelisk, 1); recipe.addInput(Biomass, 10); recipe.addOutput(GasNobelisk, 1); @@ -461,7 +675,7 @@ public class Database { } { // Cluster Nobelisk - Recipe recipe = new Recipe(24, Assembler.class); //TODO EquipmentWorkshop + Recipe recipe = new Recipe(24, Buildings.ASSEMBLER); //TODO EquipmentWorkshop recipe.addInput(Nobelisk, 3); recipe.addInput(SmokelessPowder, 4); recipe.addOutput(ClusterNobelisk, 1); @@ -470,7 +684,7 @@ public class Database { } { // NobeliskDetonator - Recipe recipe = new Recipe(80, EquipmentWorkshop.class); + Recipe recipe = new Recipe(80, Buildings.EQUIPMENT_WORKSHOP); recipe.addInput(ObjectScanner, 1); recipe.addInput(SteelBeam, 10); recipe.addInput(Cable, 50); @@ -479,31 +693,31 @@ public class Database { } { // Smart Plating - Recipe recipe = new Recipe(30, false, Assembler.class); + Recipe recipe = new Recipe(30, false, Buildings.ASSEMBLER); recipe.addInput(ReinforcedIronPlate); recipe.addInput(Rotor); SmartPlating.add(recipe); } { // Automated Wiring - Recipe recipe = new Recipe(24, false, Assembler.class); + Recipe recipe = new Recipe(24, false, Buildings.ASSEMBLER); recipe.addInput(Stator); recipe.addInput(Cable, 20); AutomatedWiring.add(recipe); } { // Versatile Framework - Recipe recipe = new Recipe(24, false, Assembler.class); + Recipe recipe = new Recipe(24, false, Buildings.ASSEMBLER); recipe.addInput(ModularFrame); recipe.addInput(SteelBeam, 12); VersatileFrameWork.add(recipe, 2); } { // Fuel - Recipe residualFuel = new Recipe(6, "Residual Fuel", false, Refinery.class); + Recipe residualFuel = new Recipe(6, "Residual Fuel", false, Buildings.REFINERY); residualFuel.addInput(HeavyOilResidue, 6); Fuel.add(residualFuel, 4); - Recipe recipe = new Recipe(6, false, Refinery.class); + Recipe recipe = new Recipe(6, false, Buildings.REFINERY); recipe.addInput(CrudeOil, 6); recipe.addOutput(PolymerResin, 3); Fuel.add(recipe, 4); @@ -513,7 +727,7 @@ public class Database { { PolymerResin.setPreference(PolymerResin.getRecipe()); // Polymer Resin - Recipe polymerResin = new Recipe(1, Refinery.class); + Recipe polymerResin = new Recipe(1, Buildings.REFINERY); // TODO: duration=60/130 polymerResin.addInput(CrudeOil, 6); polymerResin.addOutput(PolymerResin, 13); @@ -522,12 +736,12 @@ public class Database { } { // Liquid Biofuel - Recipe recipe = new Recipe(4, false, Refinery.class); + Recipe recipe = new Recipe(4, false, Buildings.REFINERY); recipe.addInput(SolidBiofuel, 6); recipe.addInput(Water, 3); LiquidBiofuel.add(recipe, 4); - Recipe unpack = new Recipe(2, Packager.class); + Recipe unpack = new Recipe(2, Buildings.PACKAGER); recipe.addInput(PackagedLiquidBiofuel, 2); recipe.addOutput(LiquidBiofuel, 2); recipe.addOutput(EmptyCanister, 2); @@ -539,11 +753,11 @@ public class Database { } { // Plastic - Recipe recipe = new Recipe(6, false, Refinery.class); + Recipe recipe = new Recipe(6, false, Buildings.REFINERY); recipe.addInput(CrudeOil, 3); recipe.addOutput(HeavyOilResidue, 1); Plastic.add(recipe, 2); - Recipe residualPlastic = new Recipe(6, "Residual Plastic", false, Refinery.class); + Recipe residualPlastic = new Recipe(6, "Residual Plastic", false, Buildings.REFINERY); residualPlastic.addInput(PolymerResin, 6); residualPlastic.addInput(Water, 2); Plastic.add(residualPlastic, 2); @@ -552,11 +766,11 @@ public class Database { } { // Rubber - Recipe recipe = new Recipe(6, false, Refinery.class); + Recipe recipe = new Recipe(6, false, Buildings.REFINERY); recipe.addInput(CrudeOil, 3); recipe.addOutput(HeavyOilResidue, 2); Rubber.add(recipe, 2); - Recipe residualRubber = new Recipe(6, "Residual Rubber", false, Refinery.class); + Recipe residualRubber = new Recipe(6, "Residual Rubber", false, Buildings.REFINERY); residualRubber.addInput(PolymerResin, 6); residualRubber.addInput(Water, 4); Rubber.add(residualRubber, 2); @@ -565,76 +779,76 @@ public class Database { } { // Petroleum Coke - Recipe recipe = new Recipe(6, false, Refinery.class); + Recipe recipe = new Recipe(6, false, Buildings.REFINERY); recipe.addInput(HeavyOilResidue, 4); PetroleumCoke.add(recipe, 12); } // TODO: verify below! { - Recipe recipe = new Recipe(6, AluminumIngot, 3, Assembler.class); + Recipe recipe = new Recipe(6, AluminumIngot, 3, Buildings.ASSEMBLER); recipe.addInput(CopperIngot, 1); AlcladAluminumSheet.add(recipe, 3); } { - Recipe recipe = new Recipe(120, QuartzCristal, 36, Manufacturer.class); + Recipe recipe = new Recipe(120, QuartzCristal, 36, Buildings.MANUFACTURER); recipe.addInput(Cable, 28); recipe.addInput(ReinforcedIronPlate, 5); CrystalOscillator.add(recipe, 2); } { - Recipe recipe = new Recipe(48, AluminumCasing, 32, Manufacturer.class); + Recipe recipe = new Recipe(48, AluminumCasing, 32, Buildings.MANUFACTURER); recipe.addInput(CrystalOscillator, 1); recipe.addInput(Computer, 1); RadioControlUnit.add(recipe, 2); } { - Recipe recipe = new Recipe(2, AluminumIngot, 3, Constructor.class); + Recipe recipe = new Recipe(2, AluminumIngot, 3, Buildings.CONSTRUCTOR); AluminumCasing.add(recipe, 2); } { - Recipe recipe = new Recipe(8, RawQuartz, 5, Constructor.class); + Recipe recipe = new Recipe(8, RawQuartz, 5, Buildings.CONSTRUCTOR); QuartzCristal.add(recipe, 3); } { - Recipe recipe = new Recipe(8, RawQuartz, 3, Constructor.class); + Recipe recipe = new Recipe(8, RawQuartz, 3, Buildings.CONSTRUCTOR); Silica.add(recipe, 5); } { - Recipe recipe = new Recipe(4, AluminumScrap, 6, Foundry.class); + Recipe recipe = new Recipe(4, AluminumScrap, 6, Buildings.FOUNDRY); recipe.addInput(Silica, 5); recipe.addOutput(AluminumIngot, 4); } { - Recipe recipe = new Recipe(6, Refinery.class); + Recipe recipe = new Recipe(6, Buildings.REFINERY); recipe.addInput(Bauxite, 12); recipe.addInput(Water, 18); recipe.addOutput(Silica, 5); recipe.addOutput(AluminaSolution, 12); } { - Recipe recipe = new Recipe(1, Refinery.class); + Recipe recipe = new Recipe(1, Buildings.REFINERY); recipe.addInput(AluminaSolution, 4); recipe.addInput(Coal, 2); recipe.addOutput(AluminumScrap, 6); recipe.addOutput(Water, 2); } { - Recipe recipe = new Recipe(6, Refinery.class); + Recipe recipe = new Recipe(6, Buildings.REFINERY); recipe.addInput(Sulfur, 5); recipe.addInput(Water, 5); recipe.addOutput(SulfuricAcid, 5); } { - Recipe recipe = new Recipe(150, Manufacturer.class); + Recipe recipe = new Recipe(150, Buildings.MANUFACTURER); recipe.addInput(EncasedUraniumCell, 50); recipe.addInput(EncasedIndustrialBeam, 3); recipe.addInput(ElectromagneticControlRod, 5); recipe.addOutput(UraniumFuelRod, 1); } { - Recipe recipe = new Recipe(12, Blender.class); + Recipe recipe = new Recipe(12, Buildings.BLENDER); recipe.addInput(Uranium, 10); recipe.addInput(Concrete, 3); recipe.addInput(SulfuricAcid, 8); @@ -642,14 +856,14 @@ public class Database { recipe.addOutput(SulfuricAcid, 2); } { - Recipe recipe = new Recipe(120, Manufacturer.class); + Recipe recipe = new Recipe(120, Buildings.MANUFACTURER); recipe.addInput(VersatileFrameWork, 5); recipe.addInput(ElectromagneticControlRod, 5); recipe.addInput(Battery, 10); recipe.addOutput(MagneticFieldGenerator, 2); } { - Recipe recipe = new Recipe(3, Blender.class); + Recipe recipe = new Recipe(3, Buildings.BLENDER); recipe.addInput(SulfuricAcid, 2.5); recipe.addInput(AluminaSolution, 2); recipe.addInput(AluminumCasing, 1); @@ -657,25 +871,25 @@ public class Database { recipe.addOutput(Water, 1.5); } { - Recipe recipe = new Recipe(8, Assembler.class); + Recipe recipe = new Recipe(8, Buildings.ASSEMBLER); recipe.addInput(AlcladAluminumSheet, 5); recipe.addInput(CopperSheet, 3); recipe.addOutput(HeatSink, 1); } { - Recipe recipe = new Recipe(80, Assembler.class); + Recipe recipe = new Recipe(80, Buildings.ASSEMBLER); recipe.addInput(AdaptiveControlUnit, 2); recipe.addInput(SuperComputer, 1); recipe.addOutput(AssemblyDirectorSystem, 1); } { - Recipe recipe = new Recipe(30, Assembler.class); + Recipe recipe = new Recipe(30, Buildings.ASSEMBLER); recipe.addInput(Stator, 3); recipe.addInput(AILimiter, 2); recipe.addOutput(ElectromagneticControlRod, 2); } { - Recipe recipe = new Recipe(10, Blender.class); + Recipe recipe = new Recipe(10, Buildings.BLENDER); recipe.addInput(HeatSink, 2); recipe.addInput(Rubber, 2); recipe.addInput(Water, 5); @@ -683,27 +897,27 @@ public class Database { recipe.addOutput(CoolingSystem, 1); } { - Recipe recipe = new Recipe(40, Blender.class); + Recipe recipe = new Recipe(40, Buildings.BLENDER); recipe.addInput(HeavyModularFrame, 1); recipe.addInput(AluminumCasing, 50); recipe.addInput(NitrogenGas, 25); recipe.addOutput(FusedModularFrame, 1); } { - Recipe recipe = new Recipe(40, true, EquipmentWorkshop.class); + Recipe recipe = new Recipe(40, true, Buildings.EQUIPMENT_WORKSHOP); recipe.addInput(IronPlate, 2); recipe.addInput(IronRod, 2); recipe.addOutput(PortableMiner, 1); } { //Turbofuel - Recipe recipe = new Recipe(3, Refinery.class); + Recipe recipe = new Recipe(3, Buildings.REFINERY); //TODO: 60/18,75 recipe.addInput(Fuel, 6); recipe.addInput(CompactedCoal, 4); recipe.addOutput(Turbofuel, 5); Turbofuel.add(recipe); - Recipe packaged = new Recipe(3, Packager.class); + Recipe packaged = new Recipe(3, Buildings.PACKAGER); recipe.addInput(PackagedTurboFuel, 2); recipe.addOutput(Turbofuel, 2); recipe.addOutput(EmptyCanister, 2); @@ -711,7 +925,7 @@ public class Database { } { // Packaged Turbofuel - Recipe recipe = new Recipe(3, Packager.class); + Recipe recipe = new Recipe(3, Buildings.PACKAGER); recipe.addInput(Turbofuel, 2); recipe.addInput(EmptyCanister, 2); recipe.addOutput(PackagedTurboFuel, 2); @@ -719,7 +933,7 @@ public class Database { } { // Compacted Coal - Recipe recipe = new Recipe(2, Assembler.class); + Recipe recipe = new Recipe(2, Buildings.ASSEMBLER); //TODO: 60/25 recipe.addInput(Coal, 5); recipe.addInput(Sulfur, 5); @@ -728,11 +942,11 @@ public class Database { } { // Iron Rebar - IronRebar.add(new Recipe(4, IronRod, 1, Constructor.class)); + IronRebar.add(new Recipe(4, IronRod, 1, Buildings.CONSTRUCTOR)); } { // Stun Rebar - Recipe recipe = new Recipe(6, Assembler.class);//TODO , EquipmentWorkshop.class) + Recipe recipe = new Recipe(6, Buildings.ASSEMBLER);//TODO , EQUIPMENT_WORKSHOP) recipe.addInput(IronRebar, 1); recipe.addInput(Quickwire, 5); recipe.addOutput(StunRebar, 1); @@ -740,7 +954,7 @@ public class Database { } { // Explosive Rebar - Recipe recipe = new Recipe(12, Manufacturer.class);//TODO , EquipmentWorkshop.class) + Recipe recipe = new Recipe(12, Buildings.MANUFACTURER);//TODO , EQUIPMENT_WORKSHOP) recipe.addInput(IronRebar, 1); recipe.addInput(SmokelessPowder, 2); recipe.addInput(SteelPipe, 2); @@ -749,7 +963,7 @@ public class Database { } { // Rebar Gun - Recipe recipe = new Recipe(60, EquipmentWorkshop.class); + Recipe recipe = new Recipe(60, Buildings.EQUIPMENT_WORKSHOP); recipe.addInput(ReinforcedIronPlate, 6); recipe.addInput(IronRod, 16); recipe.addInput(Screw, 100); @@ -758,7 +972,7 @@ public class Database { } { // Rifle Ammo - Recipe recipe = new Recipe(12, Assembler.class);//TODO , EquipmentWorkshop.class) + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);//TODO , EQUIPMENT_WORKSHOP) recipe.addInput(CopperSheet, 3); recipe.addInput(SmokelessPowder, 2); recipe.addOutput(RifleAmmo, 15); @@ -766,7 +980,7 @@ public class Database { } { // Homing Rifle Ammo - Recipe recipe = new Recipe(12, Assembler.class);//TODO , EquipmentWorkshop.class) + Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);//TODO , EQUIPMENT_WORKSHOP) recipe.addInput(RifleAmmo, 20); recipe.addInput(HighSpeedConnector, 1); recipe.addOutput(HomingRifleAmmo, 10); @@ -774,7 +988,7 @@ public class Database { } { // Rifle - Recipe recipe = new Recipe(120, EquipmentWorkshop.class); + Recipe recipe = new Recipe(120, Buildings.EQUIPMENT_WORKSHOP); recipe.addInput(Motor, 2); recipe.addInput(Rubber, 10); recipe.addInput(SteelPipe, 25); @@ -784,7 +998,7 @@ public class Database { } { // Smokeless Powder - Recipe recipe = new Recipe(6, Refinery.class); + Recipe recipe = new Recipe(6, Buildings.REFINERY); recipe.addInput(BlackPowder, 2); recipe.addInput(HeavyOilResidue, 1); recipe.addOutput(SmokelessPowder, 2); @@ -800,4 +1014,6 @@ public class Database { public static Collection getItems() { return new HashSet<>(items); } + + } diff --git a/src/main/java/satisfactory/Test.java b/src/main/java/satisfactory/Test.java index 304d7a4..0aa5a09 100644 --- a/src/main/java/satisfactory/Test.java +++ b/src/main/java/satisfactory/Test.java @@ -120,7 +120,7 @@ public class Test { planFor(Database.AlcladAluminumSheet, 100, "alclad"); - planFor(Database.UraniumFuelRod, 1, "fuelrod"); + // planFor(Database.UraniumFuelRod, 1, "fuelrod"); planFor(Database.FusedModularFrame, 100, "fusedFrame"); planFor(Database.SteelIngot, 100, "steelIngot"); diff --git a/src/main/java/satisfactory/buildings/Building.java b/src/main/java/satisfactory/buildings/Building.java index a1c07f6..819f591 100644 --- a/src/main/java/satisfactory/buildings/Building.java +++ b/src/main/java/satisfactory/buildings/Building.java @@ -8,8 +8,14 @@ import java.util.Map; public abstract class Building { protected Map cost; protected Integer power; + protected final String name; - public Building() { + public Building(String name) { + this.name = name; cost = new HashMap<>(); } + + public String getName() { + return name; + } } diff --git a/src/main/java/satisfactory/buildings/PowerGenerationBuilding.java b/src/main/java/satisfactory/buildings/PowerGenerationBuilding.java new file mode 100644 index 0000000..4074820 --- /dev/null +++ b/src/main/java/satisfactory/buildings/PowerGenerationBuilding.java @@ -0,0 +1,17 @@ +package satisfactory.buildings; + +import satisfactory.buildings.Building; +import satisfactory.items.Item; + +import java.util.Map; + +public class PowerGenerationBuilding extends Building { + protected Map consumes; + + public PowerGenerationBuilding(String name, int power, Map cost, Map consumes) { + super(name); + this.power = power; + this.cost = cost; + this.consumes = consumes; + } +} diff --git a/src/main/java/satisfactory/buildings/ProductionBuilding.java b/src/main/java/satisfactory/buildings/ProductionBuilding.java new file mode 100644 index 0000000..2c7a40d --- /dev/null +++ b/src/main/java/satisfactory/buildings/ProductionBuilding.java @@ -0,0 +1,13 @@ +package satisfactory.buildings; + +import satisfactory.items.Item; + +import java.util.Map; + +public class ProductionBuilding extends Building { + public ProductionBuilding(String name, int power, Map cost){ + super(name); + this.power = power; + this.cost = cost; + } +} diff --git a/src/main/java/satisfactory/buildings/power/BiomassBurner.java b/src/main/java/satisfactory/buildings/power/BiomassBurner.java deleted file mode 100644 index 9ef1660..0000000 --- a/src/main/java/satisfactory/buildings/power/BiomassBurner.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.power; - -import satisfactory.Database; - -public class BiomassBurner extends PowerGenerationBuilding { - public BiomassBurner() { - power = 30; - cost.put(Database.IronPlate, 15); - cost.put(Database.IronRod, 15); - cost.put(Database.Wire, 25); - consumes.put(Database.Coal, 15); - } -} diff --git a/src/main/java/satisfactory/buildings/power/CoalGenerator.java b/src/main/java/satisfactory/buildings/power/CoalGenerator.java deleted file mode 100644 index c769870..0000000 --- a/src/main/java/satisfactory/buildings/power/CoalGenerator.java +++ /dev/null @@ -1,14 +0,0 @@ -package satisfactory.buildings.power; - -import satisfactory.Database; - -public class CoalGenerator extends PowerGenerationBuilding { - public CoalGenerator() { - power = 75; - cost.put(Database.ReinforcedIronPlate, 20); - cost.put(Database.Rotor, 10); - cost.put(Database.Cable, 30); - consumes.put(Database.Coal, 15); - consumes.put(Database.PetroleumCoke, 25); - } -} diff --git a/src/main/java/satisfactory/buildings/power/FuelGenerator.java b/src/main/java/satisfactory/buildings/power/FuelGenerator.java deleted file mode 100644 index 5cfc74a..0000000 --- a/src/main/java/satisfactory/buildings/power/FuelGenerator.java +++ /dev/null @@ -1,15 +0,0 @@ -package satisfactory.buildings.power; - -import satisfactory.Database; - -public class FuelGenerator extends PowerGenerationBuilding { - public FuelGenerator() { - power = 150; - cost.put(Database.Computer, 5); - cost.put(Database.HeavyModularFrame, 10); - cost.put(Database.Motor, 15); - cost.put(Database.Rubber, 50); - cost.put(Database.Quickwire, 50); - consumes.put(Database.Fuel, 12); - } -} diff --git a/src/main/java/satisfactory/buildings/power/GeothermalGenerator.java b/src/main/java/satisfactory/buildings/power/GeothermalGenerator.java deleted file mode 100644 index 1318d58..0000000 --- a/src/main/java/satisfactory/buildings/power/GeothermalGenerator.java +++ /dev/null @@ -1,14 +0,0 @@ -package satisfactory.buildings.power; - -import satisfactory.Database; - -public class GeothermalGenerator extends PowerGenerationBuilding { - public GeothermalGenerator() { - power = 9999; // TODO - cost.put(Database.SuperComputer, 8); - cost.put(Database.HeavyModularFrame, 16); - cost.put(Database.HighSpeedConnector, 16); - cost.put(Database.CopperSheet, 40); - cost.put(Database.Rubber, 80); - } -} diff --git a/src/main/java/satisfactory/buildings/power/PowerGenerationBuilding.java b/src/main/java/satisfactory/buildings/power/PowerGenerationBuilding.java deleted file mode 100644 index 7bce3b1..0000000 --- a/src/main/java/satisfactory/buildings/power/PowerGenerationBuilding.java +++ /dev/null @@ -1,15 +0,0 @@ -package satisfactory.buildings.power; - -import satisfactory.buildings.Building; -import satisfactory.items.Item; - -import java.util.HashMap; -import java.util.Map; - -public abstract class PowerGenerationBuilding extends Building { - protected Map consumes; - - public PowerGenerationBuilding() { - consumes = new HashMap<>(); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Assembler.java b/src/main/java/satisfactory/buildings/production/Assembler.java deleted file mode 100644 index 424f364..0000000 --- a/src/main/java/satisfactory/buildings/production/Assembler.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Assembler extends Building { - public Assembler() { - power = 15; - cost.put(Database.ReinforcedIronPlate, 8); - cost.put(Database.Rotor, 4); - cost.put(Database.Cable, 10); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Blender.java b/src/main/java/satisfactory/buildings/production/Blender.java deleted file mode 100644 index e902658..0000000 --- a/src/main/java/satisfactory/buildings/production/Blender.java +++ /dev/null @@ -1,11 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.buildings.Building; - -public class Blender extends Building { - public Blender() { - power = -9999; - cost.put(null, null); - // TODO - } -} diff --git a/src/main/java/satisfactory/buildings/production/Constructor.java b/src/main/java/satisfactory/buildings/production/Constructor.java deleted file mode 100644 index e11c93d..0000000 --- a/src/main/java/satisfactory/buildings/production/Constructor.java +++ /dev/null @@ -1,12 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Constructor extends Building { - public Constructor() { - power = 4; - cost.put(Database.ReinforcedIronPlate, 2); - cost.put(Database.Cable, 8); - } -} diff --git a/src/main/java/satisfactory/buildings/production/CraftBench.java b/src/main/java/satisfactory/buildings/production/CraftBench.java deleted file mode 100644 index a4d9877..0000000 --- a/src/main/java/satisfactory/buildings/production/CraftBench.java +++ /dev/null @@ -1,12 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class CraftBench extends Building { - public CraftBench() { - power = null; - cost.put(Database.IronPlate, 3); - cost.put(Database.IronRod, 3); - } -} diff --git a/src/main/java/satisfactory/buildings/production/EquipmentWorkshop.java b/src/main/java/satisfactory/buildings/production/EquipmentWorkshop.java deleted file mode 100644 index fbf865d..0000000 --- a/src/main/java/satisfactory/buildings/production/EquipmentWorkshop.java +++ /dev/null @@ -1,12 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class EquipmentWorkshop extends Building { - public EquipmentWorkshop() { - power = null; - cost.put(Database.IronPlate, 6); - cost.put(Database.IronRod, 4); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Foundry.java b/src/main/java/satisfactory/buildings/production/Foundry.java deleted file mode 100644 index a1f8b71..0000000 --- a/src/main/java/satisfactory/buildings/production/Foundry.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Foundry extends Building { - public Foundry() { - power = 16; - cost.put(Database.ModularFrame, 10); - cost.put(Database.Rotor, 10); - cost.put(Database.Concrete, 20); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Manufacturer.java b/src/main/java/satisfactory/buildings/production/Manufacturer.java deleted file mode 100644 index 53b4c34..0000000 --- a/src/main/java/satisfactory/buildings/production/Manufacturer.java +++ /dev/null @@ -1,14 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Manufacturer extends Building { - public Manufacturer() { - power = 55; - cost.put(Database.Motor, 5); - cost.put(Database.HeavyModularFrame, 10); - cost.put(Database.Cable, 50); - cost.put(Database.Plastic, 50); - } -} diff --git a/src/main/java/satisfactory/buildings/production/MinerMk1.java b/src/main/java/satisfactory/buildings/production/MinerMk1.java deleted file mode 100644 index 9f67cec..0000000 --- a/src/main/java/satisfactory/buildings/production/MinerMk1.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class MinerMk1 extends Building { - public MinerMk1() { - power = 5; - cost.put(Database.PortableMiner, 1); - cost.put(Database.IronPlate, 10); - cost.put(Database.Concrete, 10); - } -} diff --git a/src/main/java/satisfactory/buildings/production/MinerMk2.java b/src/main/java/satisfactory/buildings/production/MinerMk2.java deleted file mode 100644 index 87ba7ff..0000000 --- a/src/main/java/satisfactory/buildings/production/MinerMk2.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; - -public class MinerMk2 extends MinerMk1 { - public MinerMk2() { - power = 12; - cost.put(Database.PortableMiner, 2); - cost.put(Database.EncasedIndustrialBeam, 10); - cost.put(Database.SteelPipe, 20); - cost.put(Database.ModularFrame, 10); - } -} diff --git a/src/main/java/satisfactory/buildings/production/MinerMk3.java b/src/main/java/satisfactory/buildings/production/MinerMk3.java deleted file mode 100644 index 297e898..0000000 --- a/src/main/java/satisfactory/buildings/production/MinerMk3.java +++ /dev/null @@ -1,14 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; - -public class MinerMk3 extends MinerMk1 { - public MinerMk3() { - // TODO: real values! - power = 12; - cost.put(Database.PortableMiner, 2); - cost.put(Database.EncasedIndustrialBeam, 10); - cost.put(Database.SteelPipe, 20); - cost.put(Database.ModularFrame, 10); - } -} diff --git a/src/main/java/satisfactory/buildings/production/OilExtractor.java b/src/main/java/satisfactory/buildings/production/OilExtractor.java deleted file mode 100644 index 1b7f38d..0000000 --- a/src/main/java/satisfactory/buildings/production/OilExtractor.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class OilExtractor extends Building { - public OilExtractor() { - power = 40; - cost.put(Database.Motor, 15); - cost.put(Database.EncasedIndustrialBeam, 20); - cost.put(Database.Cable, 60); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Packager.java b/src/main/java/satisfactory/buildings/production/Packager.java deleted file mode 100644 index 14ffcbc..0000000 --- a/src/main/java/satisfactory/buildings/production/Packager.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Packager extends Building { - public Packager() { - power = 10; - cost.put(Database.SteelBeam, 20); - cost.put(Database.Rubber, 10); - cost.put(Database.Plastic, 10); - } -} diff --git a/src/main/java/satisfactory/buildings/production/Refinery.java b/src/main/java/satisfactory/buildings/production/Refinery.java deleted file mode 100644 index a12c529..0000000 --- a/src/main/java/satisfactory/buildings/production/Refinery.java +++ /dev/null @@ -1,14 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Refinery extends Building { - public Refinery() { - power = 30; - cost.put(Database.Motor, 10); - cost.put(Database.EncasedIndustrialBeam, 10); - cost.put(Database.SteelPipe, 30); - cost.put(Database.CopperSheet, 20); - } -} diff --git a/src/main/java/satisfactory/buildings/production/ResourceWellExtractor.java b/src/main/java/satisfactory/buildings/production/ResourceWellExtractor.java deleted file mode 100644 index 93811d3..0000000 --- a/src/main/java/satisfactory/buildings/production/ResourceWellExtractor.java +++ /dev/null @@ -1,11 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.buildings.Building; - -public class ResourceWellExtractor extends Building { - public ResourceWellExtractor() { - power = -9999; - cost.put(null, null); - // TODO - } -} diff --git a/src/main/java/satisfactory/buildings/production/Smelter.java b/src/main/java/satisfactory/buildings/production/Smelter.java deleted file mode 100644 index f60f5a9..0000000 --- a/src/main/java/satisfactory/buildings/production/Smelter.java +++ /dev/null @@ -1,12 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class Smelter extends Building { - public Smelter() { - power = 4; - cost.put(Database.IronRod, 5); - cost.put(Database.Wire, 8); - } -} diff --git a/src/main/java/satisfactory/buildings/production/WaterExtractor.java b/src/main/java/satisfactory/buildings/production/WaterExtractor.java deleted file mode 100644 index 520d9b4..0000000 --- a/src/main/java/satisfactory/buildings/production/WaterExtractor.java +++ /dev/null @@ -1,13 +0,0 @@ -package satisfactory.buildings.production; - -import satisfactory.Database; -import satisfactory.buildings.Building; - -public class WaterExtractor extends Building { - public WaterExtractor() { - power = 20; - cost.put(Database.CopperSheet, 20); - cost.put(Database.ReinforcedIronPlate, 10); - cost.put(Database.Rotor, 10); - } -} diff --git a/src/main/java/satisfactory/items/Recipe.java b/src/main/java/satisfactory/items/Recipe.java index 4d604d2..06d26af 100644 --- a/src/main/java/satisfactory/items/Recipe.java +++ b/src/main/java/satisfactory/items/Recipe.java @@ -15,32 +15,32 @@ public class Recipe { private final Map inputs; private final Map outputs; private final int duration; - private final Class building; + private final Building building; private boolean isHandCraftable = true; private String name; - public Recipe(int duration, Class building) { + public Recipe(int duration, Building building) { this(duration, new HashMap<>(), new HashMap<>(), building); } - public Recipe(int duration, boolean isHandCraftable, Class building) { + public Recipe(int duration, boolean isHandCraftable, Building building) { this(duration, building); this.isHandCraftable = isHandCraftable; } - public Recipe(int duration, Item item, int input, Class building) { + public Recipe(int duration, Item item, int input, Building building) { this(duration, building); addInput(item, input); } - public Recipe(int duration, Map inputs, Map outputs, Class building) { + public Recipe(int duration, Map inputs, Map outputs, Building building) { this.duration = duration; this.inputs = inputs; this.outputs = outputs; this.building = building; } - public Recipe(int duration, String name, boolean isHandCraftable, Class building) { + public Recipe(int duration, String name, boolean isHandCraftable, Building building) { this(duration, building); this.name = name; this.isHandCraftable = isHandCraftable; @@ -240,7 +240,7 @@ public class Recipe { return new SumResult(production, map); } - public Class getBuilding() { + public Building getBuilding() { return building; } diff --git a/src/main/java/satisfactory/items/SumResult.java b/src/main/java/satisfactory/items/SumResult.java index 6eb3ec6..46b0005 100644 --- a/src/main/java/satisfactory/items/SumResult.java +++ b/src/main/java/satisfactory/items/SumResult.java @@ -78,15 +78,15 @@ public class SumResult { return new SumResult(merge(production, other.getProduction()), map); } - public Map, Map> getBuildings() { - Map, Map> buildings = new HashMap<>(); + public Map< Building, Map> getBuildings() { + Map> buildings = new HashMap<>(); for (Item item : production.vertexSet()) { double n = 0.0; for (ProductionEdge edge : production.outgoingEdgesOf(item)) { n += edge.getInstances(); } Recipe recipe = item.getRecipe(); - Class building = recipe.getBuilding(); + Building building = recipe.getBuilding(); HashMap value = (HashMap) buildings.getOrDefault(building, new HashMap<>()); value.put(recipe, value.getOrDefault(recipe, 0.0) + n); @@ -95,9 +95,9 @@ public class SumResult { return buildings; } - public static String format(Map, Map> buildings){ + public static String format(Map< Building, Map> buildings){ StringBuilder sb = new StringBuilder(); - for (Map.Entry, Map> entry : buildings.entrySet()) { + for (Map.Entry< Building, Map> entry : buildings.entrySet()) { double sum = 0.0; StringBuilder internal = new StringBuilder(); for (Map.Entry recipes : entry.getValue().entrySet()) {