migrate buildings to instances

master
agp8x 2023-04-10 00:03:06 +02:00
parent e6559760aa
commit 9f5ecdee8a
28 changed files with 378 additions and 400 deletions

View File

@ -1,6 +1,8 @@
package satisfactory; 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.Item;
import satisfactory.items.Recipe; import satisfactory.items.Recipe;
import satisfactory.items.type.*; import satisfactory.items.type.*;
@ -8,6 +10,218 @@ import satisfactory.items.type.*;
import java.util.*; import java.util.*;
public class Database { 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<Item, Integer> assembler() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.ReinforcedIronPlate, 8);
cost.put(Database.Rotor, 4);
cost.put(Database.Cable, 10);
return cost;
}
private static Map<Item, Integer> blender() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(null, null); //FIXME values
return cost;
}
private static Map<Item, Integer> constructor() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.ReinforcedIronPlate, 2);
cost.put(Database.Cable, 8);
return cost;
}
private static Map<Item, Integer> craftBench() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.IronPlate, 3);
cost.put(Database.IronRod, 3);
return cost;
}
private static Map<Item, Integer> equipmentWorkshop() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.IronPlate, 6);
cost.put(Database.IronRod, 4);
return cost;
}
private static Map<Item, Integer> foundry() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.ModularFrame, 10);
cost.put(Database.Rotor, 10);
cost.put(Database.Concrete, 20);
return cost;
}
private static Map<Item, Integer> manufacturer() {
Map<Item, Integer> 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<Item, Integer> minerMk1() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.PortableMiner, 1);
cost.put(Database.IronPlate, 10);
cost.put(Database.Concrete, 10);
return cost;
}
private static Map<Item, Integer> minerMk2() {
Map<Item, Integer> 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<Item, Integer> minerMk3() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.PortableMiner, 2);
cost.put(null, null); //FIXME values
return cost;
}
private static Map<Item, Integer> oilExtractor() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.Motor, 15);
cost.put(Database.EncasedIndustrialBeam, 20);
cost.put(Database.Cable, 60);
return cost;
}
private static Map<Item, Integer> packager() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.SteelBeam, 20);
cost.put(Database.Rubber, 10);
cost.put(Database.Plastic, 10);
return cost;
}
private static Map<Item, Integer> refinery() {
Map<Item, Integer> 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<Item, Integer> resourceWellExtractor() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(null, null); // FIXME values
return cost;
}
private static Map<Item, Integer> smelter() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.IronRod, 5);
cost.put(Database.Wire, 8);
return cost;
}
private static Map<Item, Integer> waterExtractor() {
Map<Item, Integer> 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<Item, Integer> biomassBurner() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.IronPlate, 15);
cost.put(Database.IronRod, 15);
cost.put(Database.Wire, 25);
return cost;
}
private static Map<Item, Double> biomassBurnerConsumes() {
Map<Item, Double> cost = new HashMap<>();
// TODO values usage/min
return cost;
}
private static Map<Item, Integer> coalGenerator() {
Map<Item, Integer> cost = new HashMap<>();
cost.put(Database.ReinforcedIronPlate, 20);
cost.put(Database.Rotor, 10);
cost.put(Database.Cable, 30);
return cost;
}
private static Map<Item, Double> coalGeneratorConsumes() {
Map<Item, Double> cost = new HashMap<>();
// TODO values usage/min
return cost;
}
private static Map<Item, Integer> fuelGenerator() {
Map<Item, Integer> 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<Item, Double> fuelGeneratorConsumes() {
Map<Item, Double> cost = new HashMap<>();
// TODO values usage/min
return cost;
}
private static Map<Item, Integer> geothermalGenerator() {
Map<Item, Integer> 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<Item, Recipe> preferences = new HashMap<>(); public static final Map<Item, Recipe> preferences = new HashMap<>();
// Items & recipes // Items & recipes
public static final Item IronOre = new Ore("Iron Ore"); public static final Item IronOre = new Ore("Iron Ore");
@ -128,11 +342,11 @@ public class Database {
Set<Item> ores = new HashSet<>(Arrays.asList(IronOre, Coal, Limestone, CopperOre, CateriumOre, Sulfur, Uranium)); Set<Item> ores = new HashSet<>(Arrays.asList(IronOre, Coal, Limestone, CopperOre, CateriumOre, Sulfur, Uranium));
ores.addAll(Arrays.asList(Bauxite, RawQuartz));// TODO: rly? ores.addAll(Arrays.asList(Bauxite, RawQuartz));// TODO: rly?
for (Item ore : ores) { 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); 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); 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.add(mk3, 3);
ore.setPreference(mk2); ore.setPreference(mk2);
} }
@ -140,19 +354,19 @@ public class Database {
// fluids // fluids
Set<Item> rawFluids = new HashSet<>(Arrays.asList(CrudeOil, Water)); Set<Item> rawFluids = new HashSet<>(Arrays.asList(CrudeOil, Water));
// no common well yet // 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(); //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.add(water, 2);
Water.setPreference(water); Water.setPreference(water);
// gases // 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 // Iron Ingot
IronIngot.add(new Recipe(2, IronOre, 1, Smelter.class)); IronIngot.add(new Recipe(2, IronOre, 1, Buildings.SMELTER));
Recipe alt = new Recipe(12, Refinery.class); Recipe alt = new Recipe(12, Buildings.REFINERY);
alt.addInput(IronOre, 7); alt.addInput(IronOre, 7);
alt.addInput(Water, 4); alt.addInput(Water, 4);
alt.addOutput(IronIngot, 13); alt.addOutput(IronIngot, 13);
@ -160,28 +374,28 @@ public class Database {
} }
{ {
// Copper Ingot // Copper Ingot
CopperIngot.add(new Recipe(2, CopperOre, 1, Smelter.class)); CopperIngot.add(new Recipe(2, CopperOre, 1, Buildings.SMELTER));
} }
{ {
// Caterium Ingot // Caterium Ingot
CateriumIngot.add(new Recipe(4, CateriumOre, 3, Smelter.class)); CateriumIngot.add(new Recipe(4, CateriumOre, 3, Buildings.SMELTER));
} }
{ {
// Steel Ingot // Steel Ingot
Recipe recipe = new Recipe(4, Foundry.class); Recipe recipe = new Recipe(4, Buildings.FOUNDRY);
recipe.addInput(IronOre, 3); recipe.addInput(IronOre, 3);
recipe.addInput(Coal, 3); recipe.addInput(Coal, 3);
SteelIngot.add(recipe, 3); SteelIngot.add(recipe, 3);
} }
{ {
// Concrete // Concrete
Concrete.add(new Recipe(4, Limestone, 3, Constructor.class)); Concrete.add(new Recipe(4, Limestone, 3, Buildings.CONSTRUCTOR));
} }
{ {
// Iron Plate // Iron Plate
Recipe recipe = new Recipe(6, IronIngot, 3, Constructor.class); Recipe recipe = new Recipe(6, IronIngot, 3, Buildings.CONSTRUCTOR);
IronPlate.add(recipe, 2); 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(SteelIngot, 3);
steelCoated.addInput(Plastic, 2); steelCoated.addInput(Plastic, 2);
IronPlate.add(steelCoated, 18); IronPlate.add(steelCoated, 18);
@ -189,23 +403,23 @@ public class Database {
} }
{ {
// Iron Rod // Iron Rod
IronRod.add(new Recipe(4, IronIngot, 1, Constructor.class)); IronRod.add(new Recipe(4, IronIngot, 1, Buildings.CONSTRUCTOR));
} }
{ {
// Screw // Screw
Screw.add(new Recipe(6, IronRod, 1, Constructor.class), 4); Screw.add(new Recipe(6, IronRod, 1, Buildings.CONSTRUCTOR), 4);
} }
{ {
// Steel Beam // Steel Beam
SteelBeam.add(new Recipe(4, SteelIngot, 4, Constructor.class)); SteelBeam.add(new Recipe(4, SteelIngot, 4, Buildings.CONSTRUCTOR));
} }
{ {
// Reinforced Iron Plate // Reinforced Iron Plate
Recipe recipe = new Recipe(12, Assembler.class); Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);
recipe.addInput(IronPlate, 6); recipe.addInput(IronPlate, 6);
recipe.addInput(Screw, 12); recipe.addInput(Screw, 12);
ReinforcedIronPlate.add(recipe); 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(IronPlate, 18);
bolted.addInput(Screw, 50); bolted.addInput(Screw, 50);
ReinforcedIronPlate.add(bolted, 3); ReinforcedIronPlate.add(bolted, 3);
@ -214,34 +428,34 @@ public class Database {
} }
{ {
// Modular Frame // Modular Frame
Recipe recipe = new Recipe(60, Assembler.class); Recipe recipe = new Recipe(60, Buildings.ASSEMBLER);
recipe.addInput(ReinforcedIronPlate, 3); recipe.addInput(ReinforcedIronPlate, 3);
recipe.addInput(IronRod, 12); recipe.addInput(IronRod, 12);
ModularFrame.add(recipe, 2); ModularFrame.add(recipe, 2);
} }
{ {
// Steel Pipe // Steel Pipe
Recipe recipe = new Recipe(6, Constructor.class); Recipe recipe = new Recipe(6, Buildings.CONSTRUCTOR);
recipe.addInput(SteelIngot, 3); recipe.addInput(SteelIngot, 3);
SteelPipe.add(recipe, 2); SteelPipe.add(recipe, 2);
} }
{ {
// Encased Industrial Beam // Encased Industrial Beam
Recipe recipe = new Recipe(10, Assembler.class); Recipe recipe = new Recipe(10, Buildings.ASSEMBLER);
recipe.addInput(SteelBeam, 4); recipe.addInput(SteelBeam, 4);
recipe.addInput(Concrete, 5); recipe.addInput(Concrete, 5);
EncasedIndustrialBeam.add(recipe); EncasedIndustrialBeam.add(recipe);
} }
{ {
// Heavy Modular Frame // Heavy Modular Frame
Recipe recipe = new Recipe(30, Manufacturer.class); Recipe recipe = new Recipe(30, Buildings.MANUFACTURER);
recipe.addInput(ModularFrame, 5); recipe.addInput(ModularFrame, 5);
recipe.addInput(SteelPipe, 15); recipe.addInput(SteelPipe, 15);
recipe.addInput(EncasedIndustrialBeam, 5); recipe.addInput(EncasedIndustrialBeam, 5);
recipe.addInput(Screw, 100); recipe.addInput(Screw, 100);
HeavyModularFrame.add(recipe); HeavyModularFrame.add(recipe);
HeavyModularFrame.setPreference(recipe); HeavyModularFrame.setPreference(recipe);
Recipe heavyEncasedFrame = new Recipe(21, Manufacturer.class); Recipe heavyEncasedFrame = new Recipe(21, Buildings.MANUFACTURER);
// TODO: duration = 60/2.812 // TODO: duration = 60/2.812
heavyEncasedFrame.addInput(ModularFrame, 8); heavyEncasedFrame.addInput(ModularFrame, 8);
heavyEncasedFrame.addInput(EncasedIndustrialBeam, 10); heavyEncasedFrame.addInput(EncasedIndustrialBeam, 10);
@ -252,12 +466,12 @@ public class Database {
} }
{ {
// Wire // Wire
Wire.add(new Recipe(4, CopperIngot, 1, Constructor.class), 2); Wire.add(new Recipe(4, CopperIngot, 1, Buildings.CONSTRUCTOR), 2);
} }
{ {
// Cable // Cable
Cable.add(new Recipe(2, Wire, 2, Constructor.class)); Cable.add(new Recipe(2, Wire, 2, Buildings.CONSTRUCTOR));
Recipe quickWireCable = new Recipe(2, Assembler.class); Recipe quickWireCable = new Recipe(2, Buildings.ASSEMBLER);
// TODO 60/27,5 // TODO 60/27,5
quickWireCable.addInput(Quickwire, 3); quickWireCable.addInput(Quickwire, 3);
quickWireCable.addInput(Rubber, 2); quickWireCable.addInput(Rubber, 2);
@ -266,8 +480,8 @@ public class Database {
} }
{ {
// Copper Sheet // Copper Sheet
CopperSheet.add(new Recipe(6, CopperIngot, 2, Constructor.class)); CopperSheet.add(new Recipe(6, CopperIngot, 2, Buildings.CONSTRUCTOR));
Recipe steamedCopperSheet = new Recipe(2, Refinery.class); Recipe steamedCopperSheet = new Recipe(2, Buildings.REFINERY);
// TODO: duration = 60/22.5 // TODO: duration = 60/22.5
steamedCopperSheet.addInput(CopperIngot, 3); steamedCopperSheet.addInput(CopperIngot, 3);
steamedCopperSheet.addInput(Water, 3); steamedCopperSheet.addInput(Water, 3);
@ -277,16 +491,16 @@ public class Database {
} }
{ {
// Quickwire // Quickwire
Quickwire.add(new Recipe(5, CateriumIngot, 1, Constructor.class), 5); Quickwire.add(new Recipe(5, CateriumIngot, 1, Buildings.CONSTRUCTOR), 5);
} }
{ {
// Circuit Board // Circuit Board
Recipe recipe = new Recipe(8, Assembler.class); Recipe recipe = new Recipe(8, Buildings.ASSEMBLER);
recipe.addInput(CopperSheet, 2); recipe.addInput(CopperSheet, 2);
recipe.addInput(Plastic, 4); recipe.addInput(Plastic, 4);
CircuitBoard.add(recipe); CircuitBoard.add(recipe);
// TODO: alternative // TODO: alternative
Recipe electrodeCircuitBoard = new Recipe(12, Assembler.class); Recipe electrodeCircuitBoard = new Recipe(12, Buildings.ASSEMBLER);
electrodeCircuitBoard.addInput(Rubber, 6); electrodeCircuitBoard.addInput(Rubber, 6);
electrodeCircuitBoard.addInput(PetroleumCoke, 9); electrodeCircuitBoard.addInput(PetroleumCoke, 9);
electrodeCircuitBoard.addOutput(CircuitBoard, 1); electrodeCircuitBoard.addOutput(CircuitBoard, 1);
@ -294,14 +508,14 @@ public class Database {
} }
{ {
// A.I. Limiter // A.I. Limiter
Recipe recipe = new Recipe(12, Assembler.class); Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);
recipe.addInput(CopperSheet, 5); recipe.addInput(CopperSheet, 5);
recipe.addInput(Quickwire, 20); recipe.addInput(Quickwire, 20);
AILimiter.add(recipe); AILimiter.add(recipe);
} }
{ {
// High Speed Connector // High Speed Connector
Recipe recipe = new Recipe(16, Manufacturer.class); Recipe recipe = new Recipe(16, Buildings.MANUFACTURER);
recipe.addInput(Quickwire, 56); recipe.addInput(Quickwire, 56);
recipe.addInput(Cable, 10); recipe.addInput(Cable, 10);
recipe.addInput(CircuitBoard, 1); recipe.addInput(CircuitBoard, 1);
@ -309,48 +523,48 @@ public class Database {
} }
{ {
// Biomass // Biomass
Biomass.add(new Recipe(5, Leaves, 10, Constructor.class), 5); // TODO CraftBench Biomass.add(new Recipe(5, Leaves, 10, Buildings.CONSTRUCTOR), 5); // TODO CraftBench
Biomass.add(new Recipe(4, Wood, 4, Constructor.class), 20); // TODO CraftBench Biomass.add(new Recipe(4, Wood, 4, Buildings.CONSTRUCTOR), 20); // TODO CraftBench
Biomass.add(new Recipe(4, Mycelia, 1, Constructor.class), 10); // TODO CraftBench Biomass.add(new Recipe(4, Mycelia, 1, Buildings.CONSTRUCTOR), 10); // TODO CraftBench
Biomass.add(new Recipe(4, AlienProtein, 1, Constructor.class), 100); // TODO CraftBench Biomass.add(new Recipe(4, AlienProtein, 1, Buildings.CONSTRUCTOR), 100); // TODO CraftBench
} }
{ {
// Alien Protein // Alien Protein
AlienProtein.add(new Recipe(3, HogRemains, 1, Constructor.class)); // TODO CraftBench AlienProtein.add(new Recipe(3, HogRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench
AlienProtein.add(new Recipe(3, PlasmaSpitterRemains, 1, Constructor.class)); // TODO CraftBench AlienProtein.add(new Recipe(3, PlasmaSpitterRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench
AlienProtein.add(new Recipe(3, StingerRemains, 1, Constructor.class)); // TODO CraftBench AlienProtein.add(new Recipe(3, StingerRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench
AlienProtein.add(new Recipe(3, HatcherRemains, 1, Constructor.class)); // TODO CraftBench AlienProtein.add(new Recipe(3, HatcherRemains, 1, Buildings.CONSTRUCTOR)); // TODO CraftBench
} }
{ {
// Fabric // Fabric
Recipe recipe = new Recipe(4, Assembler.class); Recipe recipe = new Recipe(4, Buildings.ASSEMBLER);
recipe.addInput(Mycelia); recipe.addInput(Mycelia);
recipe.addInput(Biomass, 5); recipe.addInput(Biomass, 5);
Fabric.add(recipe); Fabric.add(recipe);
Recipe alt = new Recipe(2, Refinery.class); Recipe alt = new Recipe(2, Buildings.REFINERY);
recipe.addInput(PolymerResin, 1); recipe.addInput(PolymerResin, 1);
recipe.addInput(Water, 1); recipe.addInput(Water, 1);
recipe.addOutput(Fabric, 1); recipe.addOutput(Fabric, 1);
} }
{ {
// Solid Biofuel // Solid Biofuel
SolidBiofuel.add(new Recipe(4, Biomass, 8, Constructor.class), 4); SolidBiofuel.add(new Recipe(4, Biomass, 8, Buildings.CONSTRUCTOR), 4);
} }
{ {
// Rotor // Rotor
Recipe recipe = new Recipe(15, Assembler.class); Recipe recipe = new Recipe(15, Buildings.ASSEMBLER);
recipe.addInput(IronRod, 5); recipe.addInput(IronRod, 5);
recipe.addInput(Screw, 25); recipe.addInput(Screw, 25);
Rotor.add(recipe); Rotor.add(recipe);
} }
{ {
// Stator // Stator
Recipe recipe = new Recipe(12, Assembler.class); Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);
recipe.addInput(SteelPipe, 3); recipe.addInput(SteelPipe, 3);
recipe.addInput(Wire, 8); recipe.addInput(Wire, 8);
Stator.add(recipe); Stator.add(recipe);
Stator.setPreference(recipe); Stator.setPreference(recipe);
Recipe quickwireStator = new Recipe(8, Assembler.class); Recipe quickwireStator = new Recipe(8, Buildings.ASSEMBLER);
//TODO 60/8 //TODO 60/8
quickwireStator.addInput(SteelPipe, 4); quickwireStator.addInput(SteelPipe, 4);
quickwireStator.addInput(Quickwire, 15); quickwireStator.addInput(Quickwire, 15);
@ -359,31 +573,31 @@ public class Database {
} }
{ {
// Motor // Motor
Recipe recipe = new Recipe(12, Assembler.class); Recipe recipe = new Recipe(12, Buildings.ASSEMBLER);
recipe.addInput(Rotor, 2); recipe.addInput(Rotor, 2);
recipe.addInput(Stator, 2); recipe.addInput(Stator, 2);
Motor.add(recipe); Motor.add(recipe);
} }
{ {
// Power Shard // Power Shard
PowerShard.add(new Recipe(8, GreenPowerSlug, 1, Constructor.class)); PowerShard.add(new Recipe(8, GreenPowerSlug, 1, Buildings.CONSTRUCTOR));
PowerShard.add(new Recipe(12, YellowPowerSlug, 1, Constructor.class), 2); PowerShard.add(new Recipe(12, YellowPowerSlug, 1, Buildings.CONSTRUCTOR), 2);
PowerShard.add(new Recipe(24, PurplePowerSlug, 1, Constructor.class), 5); PowerShard.add(new Recipe(24, PurplePowerSlug, 1, Buildings.CONSTRUCTOR), 5);
} }
{ {
// Black Powder // Black Powder
Recipe recipe = new Recipe(8, Assembler.class); Recipe recipe = new Recipe(8, Buildings.ASSEMBLER);
recipe.addInput(Coal); recipe.addInput(Coal);
recipe.addInput(Sulfur, 2); recipe.addInput(Sulfur, 2);
BlackPowder.add(recipe); BlackPowder.add(recipe);
} }
{ {
// Color Catridge // Color Catridge
ColorCatridge.add(new Recipe(6, FlowerPetals, 5, Constructor.class), 10); ColorCatridge.add(new Recipe(6, FlowerPetals, 5, Buildings.CONSTRUCTOR), 10);
} }
{ {
// Gas Filter // Gas Filter
Recipe recipe = new Recipe(8, Manufacturer.class); Recipe recipe = new Recipe(8, Buildings.MANUFACTURER);
recipe.addInput(Coal, 5); recipe.addInput(Coal, 5);
recipe.addInput(Rubber, 2); recipe.addInput(Rubber, 2);
recipe.addInput(Fabric, 2); recipe.addInput(Fabric, 2);
@ -391,13 +605,13 @@ public class Database {
} }
{ {
// Computer // Computer
Recipe recipe = new Recipe(24, Manufacturer.class); Recipe recipe = new Recipe(24, Buildings.MANUFACTURER);
recipe.addInput(CircuitBoard, 10); recipe.addInput(CircuitBoard, 10);
recipe.addInput(Cable, 9); recipe.addInput(Cable, 9);
recipe.addInput(Plastic, 18); recipe.addInput(Plastic, 18);
recipe.addInput(Screw, 52); recipe.addInput(Screw, 52);
Computer.add(recipe); 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(CircuitBoard, 7);
alternative.addInput(Quickwire, 28); alternative.addInput(Quickwire, 28);
alternative.addInput(Rubber, 12); alternative.addInput(Rubber, 12);
@ -407,7 +621,7 @@ public class Database {
} }
{ {
// Super Computer // Super Computer
Recipe recipe = new Recipe(32, Manufacturer.class); Recipe recipe = new Recipe(32, Buildings.MANUFACTURER);
recipe.addInput(Computer, 2); recipe.addInput(Computer, 2);
recipe.addInput(AILimiter, 2); recipe.addInput(AILimiter, 2);
recipe.addInput(HighSpeedConnector, 3); recipe.addInput(HighSpeedConnector, 3);
@ -416,11 +630,11 @@ public class Database {
} }
{ {
// Empty Canister // Empty Canister
EmptyCanister.add(new Recipe(4, Plastic, 2, Constructor.class), 4); EmptyCanister.add(new Recipe(4, Plastic, 2, Buildings.CONSTRUCTOR), 4);
} }
{ {
// Beacon // Beacon
Recipe recipe = new Recipe(8, Manufacturer.class); Recipe recipe = new Recipe(8, Buildings.MANUFACTURER);
recipe.addInput(IronPlate, 3); recipe.addInput(IronPlate, 3);
recipe.addInput(IronRod); recipe.addInput(IronRod);
recipe.addInput(Wire, 15); recipe.addInput(Wire, 15);
@ -429,7 +643,7 @@ public class Database {
} }
{ {
// Modular Engine // Modular Engine
Recipe recipe = new Recipe(60, false, Manufacturer.class); Recipe recipe = new Recipe(60, false, Buildings.MANUFACTURER);
recipe.addInput(Motor, 2); recipe.addInput(Motor, 2);
recipe.addInput(Rubber, 15); recipe.addInput(Rubber, 15);
recipe.addInput(SmartPlating, 2); recipe.addInput(SmartPlating, 2);
@ -437,7 +651,7 @@ public class Database {
} }
{ {
// Adaptive Control Unit // 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(AutomatedWiring, 15);
recipe.addInput(CircuitBoard, 10); recipe.addInput(CircuitBoard, 10);
recipe.addInput(HeavyModularFrame, 2); recipe.addInput(HeavyModularFrame, 2);
@ -446,14 +660,14 @@ public class Database {
} }
{ {
// Nobelisk // Nobelisk
Recipe recipe = new Recipe(20, false, Assembler.class); Recipe recipe = new Recipe(20, false, Buildings.ASSEMBLER);
recipe.addInput(BlackPowder, 5); recipe.addInput(BlackPowder, 5);
recipe.addInput(SteelPipe, 10); recipe.addInput(SteelPipe, 10);
Nobelisk.add(recipe); Nobelisk.add(recipe);
} }
{ {
// Gas Nobelisk // 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(Nobelisk, 1);
recipe.addInput(Biomass, 10); recipe.addInput(Biomass, 10);
recipe.addOutput(GasNobelisk, 1); recipe.addOutput(GasNobelisk, 1);
@ -461,7 +675,7 @@ public class Database {
} }
{ {
// Cluster Nobelisk // 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(Nobelisk, 3);
recipe.addInput(SmokelessPowder, 4); recipe.addInput(SmokelessPowder, 4);
recipe.addOutput(ClusterNobelisk, 1); recipe.addOutput(ClusterNobelisk, 1);
@ -470,7 +684,7 @@ public class Database {
} }
{ {
// NobeliskDetonator // NobeliskDetonator
Recipe recipe = new Recipe(80, EquipmentWorkshop.class); Recipe recipe = new Recipe(80, Buildings.EQUIPMENT_WORKSHOP);
recipe.addInput(ObjectScanner, 1); recipe.addInput(ObjectScanner, 1);
recipe.addInput(SteelBeam, 10); recipe.addInput(SteelBeam, 10);
recipe.addInput(Cable, 50); recipe.addInput(Cable, 50);
@ -479,31 +693,31 @@ public class Database {
} }
{ {
// Smart Plating // Smart Plating
Recipe recipe = new Recipe(30, false, Assembler.class); Recipe recipe = new Recipe(30, false, Buildings.ASSEMBLER);
recipe.addInput(ReinforcedIronPlate); recipe.addInput(ReinforcedIronPlate);
recipe.addInput(Rotor); recipe.addInput(Rotor);
SmartPlating.add(recipe); SmartPlating.add(recipe);
} }
{ {
// Automated Wiring // Automated Wiring
Recipe recipe = new Recipe(24, false, Assembler.class); Recipe recipe = new Recipe(24, false, Buildings.ASSEMBLER);
recipe.addInput(Stator); recipe.addInput(Stator);
recipe.addInput(Cable, 20); recipe.addInput(Cable, 20);
AutomatedWiring.add(recipe); AutomatedWiring.add(recipe);
} }
{ {
// Versatile Framework // Versatile Framework
Recipe recipe = new Recipe(24, false, Assembler.class); Recipe recipe = new Recipe(24, false, Buildings.ASSEMBLER);
recipe.addInput(ModularFrame); recipe.addInput(ModularFrame);
recipe.addInput(SteelBeam, 12); recipe.addInput(SteelBeam, 12);
VersatileFrameWork.add(recipe, 2); VersatileFrameWork.add(recipe, 2);
} }
{ {
// Fuel // 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); residualFuel.addInput(HeavyOilResidue, 6);
Fuel.add(residualFuel, 4); 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.addInput(CrudeOil, 6);
recipe.addOutput(PolymerResin, 3); recipe.addOutput(PolymerResin, 3);
Fuel.add(recipe, 4); Fuel.add(recipe, 4);
@ -513,7 +727,7 @@ public class Database {
{ {
PolymerResin.setPreference(PolymerResin.getRecipe()); PolymerResin.setPreference(PolymerResin.getRecipe());
// Polymer Resin // Polymer Resin
Recipe polymerResin = new Recipe(1, Refinery.class); Recipe polymerResin = new Recipe(1, Buildings.REFINERY);
// TODO: duration=60/130 // TODO: duration=60/130
polymerResin.addInput(CrudeOil, 6); polymerResin.addInput(CrudeOil, 6);
polymerResin.addOutput(PolymerResin, 13); polymerResin.addOutput(PolymerResin, 13);
@ -522,12 +736,12 @@ public class Database {
} }
{ {
// Liquid Biofuel // Liquid Biofuel
Recipe recipe = new Recipe(4, false, Refinery.class); Recipe recipe = new Recipe(4, false, Buildings.REFINERY);
recipe.addInput(SolidBiofuel, 6); recipe.addInput(SolidBiofuel, 6);
recipe.addInput(Water, 3); recipe.addInput(Water, 3);
LiquidBiofuel.add(recipe, 4); LiquidBiofuel.add(recipe, 4);
Recipe unpack = new Recipe(2, Packager.class); Recipe unpack = new Recipe(2, Buildings.PACKAGER);
recipe.addInput(PackagedLiquidBiofuel, 2); recipe.addInput(PackagedLiquidBiofuel, 2);
recipe.addOutput(LiquidBiofuel, 2); recipe.addOutput(LiquidBiofuel, 2);
recipe.addOutput(EmptyCanister, 2); recipe.addOutput(EmptyCanister, 2);
@ -539,11 +753,11 @@ public class Database {
} }
{ {
// Plastic // Plastic
Recipe recipe = new Recipe(6, false, Refinery.class); Recipe recipe = new Recipe(6, false, Buildings.REFINERY);
recipe.addInput(CrudeOil, 3); recipe.addInput(CrudeOil, 3);
recipe.addOutput(HeavyOilResidue, 1); recipe.addOutput(HeavyOilResidue, 1);
Plastic.add(recipe, 2); 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(PolymerResin, 6);
residualPlastic.addInput(Water, 2); residualPlastic.addInput(Water, 2);
Plastic.add(residualPlastic, 2); Plastic.add(residualPlastic, 2);
@ -552,11 +766,11 @@ public class Database {
} }
{ {
// Rubber // Rubber
Recipe recipe = new Recipe(6, false, Refinery.class); Recipe recipe = new Recipe(6, false, Buildings.REFINERY);
recipe.addInput(CrudeOil, 3); recipe.addInput(CrudeOil, 3);
recipe.addOutput(HeavyOilResidue, 2); recipe.addOutput(HeavyOilResidue, 2);
Rubber.add(recipe, 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(PolymerResin, 6);
residualRubber.addInput(Water, 4); residualRubber.addInput(Water, 4);
Rubber.add(residualRubber, 2); Rubber.add(residualRubber, 2);
@ -565,76 +779,76 @@ public class Database {
} }
{ {
// Petroleum Coke // Petroleum Coke
Recipe recipe = new Recipe(6, false, Refinery.class); Recipe recipe = new Recipe(6, false, Buildings.REFINERY);
recipe.addInput(HeavyOilResidue, 4); recipe.addInput(HeavyOilResidue, 4);
PetroleumCoke.add(recipe, 12); PetroleumCoke.add(recipe, 12);
} }
// TODO: verify below! // 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); recipe.addInput(CopperIngot, 1);
AlcladAluminumSheet.add(recipe, 3); 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(Cable, 28);
recipe.addInput(ReinforcedIronPlate, 5); recipe.addInput(ReinforcedIronPlate, 5);
CrystalOscillator.add(recipe, 2); 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(CrystalOscillator, 1);
recipe.addInput(Computer, 1); recipe.addInput(Computer, 1);
RadioControlUnit.add(recipe, 2); 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); 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); 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); 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.addInput(Silica, 5);
recipe.addOutput(AluminumIngot, 4); recipe.addOutput(AluminumIngot, 4);
} }
{ {
Recipe recipe = new Recipe(6, Refinery.class); Recipe recipe = new Recipe(6, Buildings.REFINERY);
recipe.addInput(Bauxite, 12); recipe.addInput(Bauxite, 12);
recipe.addInput(Water, 18); recipe.addInput(Water, 18);
recipe.addOutput(Silica, 5); recipe.addOutput(Silica, 5);
recipe.addOutput(AluminaSolution, 12); recipe.addOutput(AluminaSolution, 12);
} }
{ {
Recipe recipe = new Recipe(1, Refinery.class); Recipe recipe = new Recipe(1, Buildings.REFINERY);
recipe.addInput(AluminaSolution, 4); recipe.addInput(AluminaSolution, 4);
recipe.addInput(Coal, 2); recipe.addInput(Coal, 2);
recipe.addOutput(AluminumScrap, 6); recipe.addOutput(AluminumScrap, 6);
recipe.addOutput(Water, 2); recipe.addOutput(Water, 2);
} }
{ {
Recipe recipe = new Recipe(6, Refinery.class); Recipe recipe = new Recipe(6, Buildings.REFINERY);
recipe.addInput(Sulfur, 5); recipe.addInput(Sulfur, 5);
recipe.addInput(Water, 5); recipe.addInput(Water, 5);
recipe.addOutput(SulfuricAcid, 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(EncasedUraniumCell, 50);
recipe.addInput(EncasedIndustrialBeam, 3); recipe.addInput(EncasedIndustrialBeam, 3);
recipe.addInput(ElectromagneticControlRod, 5); recipe.addInput(ElectromagneticControlRod, 5);
recipe.addOutput(UraniumFuelRod, 1); recipe.addOutput(UraniumFuelRod, 1);
} }
{ {
Recipe recipe = new Recipe(12, Blender.class); Recipe recipe = new Recipe(12, Buildings.BLENDER);
recipe.addInput(Uranium, 10); recipe.addInput(Uranium, 10);
recipe.addInput(Concrete, 3); recipe.addInput(Concrete, 3);
recipe.addInput(SulfuricAcid, 8); recipe.addInput(SulfuricAcid, 8);
@ -642,14 +856,14 @@ public class Database {
recipe.addOutput(SulfuricAcid, 2); recipe.addOutput(SulfuricAcid, 2);
} }
{ {
Recipe recipe = new Recipe(120, Manufacturer.class); Recipe recipe = new Recipe(120, Buildings.MANUFACTURER);
recipe.addInput(VersatileFrameWork, 5); recipe.addInput(VersatileFrameWork, 5);
recipe.addInput(ElectromagneticControlRod, 5); recipe.addInput(ElectromagneticControlRod, 5);
recipe.addInput(Battery, 10); recipe.addInput(Battery, 10);
recipe.addOutput(MagneticFieldGenerator, 2); 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(SulfuricAcid, 2.5);
recipe.addInput(AluminaSolution, 2); recipe.addInput(AluminaSolution, 2);
recipe.addInput(AluminumCasing, 1); recipe.addInput(AluminumCasing, 1);
@ -657,25 +871,25 @@ public class Database {
recipe.addOutput(Water, 1.5); 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(AlcladAluminumSheet, 5);
recipe.addInput(CopperSheet, 3); recipe.addInput(CopperSheet, 3);
recipe.addOutput(HeatSink, 1); recipe.addOutput(HeatSink, 1);
} }
{ {
Recipe recipe = new Recipe(80, Assembler.class); Recipe recipe = new Recipe(80, Buildings.ASSEMBLER);
recipe.addInput(AdaptiveControlUnit, 2); recipe.addInput(AdaptiveControlUnit, 2);
recipe.addInput(SuperComputer, 1); recipe.addInput(SuperComputer, 1);
recipe.addOutput(AssemblyDirectorSystem, 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(Stator, 3);
recipe.addInput(AILimiter, 2); recipe.addInput(AILimiter, 2);
recipe.addOutput(ElectromagneticControlRod, 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(HeatSink, 2);
recipe.addInput(Rubber, 2); recipe.addInput(Rubber, 2);
recipe.addInput(Water, 5); recipe.addInput(Water, 5);
@ -683,27 +897,27 @@ public class Database {
recipe.addOutput(CoolingSystem, 1); recipe.addOutput(CoolingSystem, 1);
} }
{ {
Recipe recipe = new Recipe(40, Blender.class); Recipe recipe = new Recipe(40, Buildings.BLENDER);
recipe.addInput(HeavyModularFrame, 1); recipe.addInput(HeavyModularFrame, 1);
recipe.addInput(AluminumCasing, 50); recipe.addInput(AluminumCasing, 50);
recipe.addInput(NitrogenGas, 25); recipe.addInput(NitrogenGas, 25);
recipe.addOutput(FusedModularFrame, 1); 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(IronPlate, 2);
recipe.addInput(IronRod, 2); recipe.addInput(IronRod, 2);
recipe.addOutput(PortableMiner, 1); recipe.addOutput(PortableMiner, 1);
} }
{ {
//Turbofuel //Turbofuel
Recipe recipe = new Recipe(3, Refinery.class); Recipe recipe = new Recipe(3, Buildings.REFINERY);
//TODO: 60/18,75 //TODO: 60/18,75
recipe.addInput(Fuel, 6); recipe.addInput(Fuel, 6);
recipe.addInput(CompactedCoal, 4); recipe.addInput(CompactedCoal, 4);
recipe.addOutput(Turbofuel, 5); recipe.addOutput(Turbofuel, 5);
Turbofuel.add(recipe); Turbofuel.add(recipe);
Recipe packaged = new Recipe(3, Packager.class); Recipe packaged = new Recipe(3, Buildings.PACKAGER);
recipe.addInput(PackagedTurboFuel, 2); recipe.addInput(PackagedTurboFuel, 2);
recipe.addOutput(Turbofuel, 2); recipe.addOutput(Turbofuel, 2);
recipe.addOutput(EmptyCanister, 2); recipe.addOutput(EmptyCanister, 2);
@ -711,7 +925,7 @@ public class Database {
} }
{ {
// Packaged Turbofuel // Packaged Turbofuel
Recipe recipe = new Recipe(3, Packager.class); Recipe recipe = new Recipe(3, Buildings.PACKAGER);
recipe.addInput(Turbofuel, 2); recipe.addInput(Turbofuel, 2);
recipe.addInput(EmptyCanister, 2); recipe.addInput(EmptyCanister, 2);
recipe.addOutput(PackagedTurboFuel, 2); recipe.addOutput(PackagedTurboFuel, 2);
@ -719,7 +933,7 @@ public class Database {
} }
{ {
// Compacted Coal // Compacted Coal
Recipe recipe = new Recipe(2, Assembler.class); Recipe recipe = new Recipe(2, Buildings.ASSEMBLER);
//TODO: 60/25 //TODO: 60/25
recipe.addInput(Coal, 5); recipe.addInput(Coal, 5);
recipe.addInput(Sulfur, 5); recipe.addInput(Sulfur, 5);
@ -728,11 +942,11 @@ public class Database {
} }
{ {
// Iron Rebar // Iron Rebar
IronRebar.add(new Recipe(4, IronRod, 1, Constructor.class)); IronRebar.add(new Recipe(4, IronRod, 1, Buildings.CONSTRUCTOR));
} }
{ {
// Stun Rebar // 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(IronRebar, 1);
recipe.addInput(Quickwire, 5); recipe.addInput(Quickwire, 5);
recipe.addOutput(StunRebar, 1); recipe.addOutput(StunRebar, 1);
@ -740,7 +954,7 @@ public class Database {
} }
{ {
// Explosive Rebar // 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(IronRebar, 1);
recipe.addInput(SmokelessPowder, 2); recipe.addInput(SmokelessPowder, 2);
recipe.addInput(SteelPipe, 2); recipe.addInput(SteelPipe, 2);
@ -749,7 +963,7 @@ public class Database {
} }
{ {
// Rebar Gun // Rebar Gun
Recipe recipe = new Recipe(60, EquipmentWorkshop.class); Recipe recipe = new Recipe(60, Buildings.EQUIPMENT_WORKSHOP);
recipe.addInput(ReinforcedIronPlate, 6); recipe.addInput(ReinforcedIronPlate, 6);
recipe.addInput(IronRod, 16); recipe.addInput(IronRod, 16);
recipe.addInput(Screw, 100); recipe.addInput(Screw, 100);
@ -758,7 +972,7 @@ public class Database {
} }
{ {
// Rifle Ammo // 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(CopperSheet, 3);
recipe.addInput(SmokelessPowder, 2); recipe.addInput(SmokelessPowder, 2);
recipe.addOutput(RifleAmmo, 15); recipe.addOutput(RifleAmmo, 15);
@ -766,7 +980,7 @@ public class Database {
} }
{ {
// Homing Rifle Ammo // 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(RifleAmmo, 20);
recipe.addInput(HighSpeedConnector, 1); recipe.addInput(HighSpeedConnector, 1);
recipe.addOutput(HomingRifleAmmo, 10); recipe.addOutput(HomingRifleAmmo, 10);
@ -774,7 +988,7 @@ public class Database {
} }
{ {
// Rifle // Rifle
Recipe recipe = new Recipe(120, EquipmentWorkshop.class); Recipe recipe = new Recipe(120, Buildings.EQUIPMENT_WORKSHOP);
recipe.addInput(Motor, 2); recipe.addInput(Motor, 2);
recipe.addInput(Rubber, 10); recipe.addInput(Rubber, 10);
recipe.addInput(SteelPipe, 25); recipe.addInput(SteelPipe, 25);
@ -784,7 +998,7 @@ public class Database {
} }
{ {
// Smokeless Powder // Smokeless Powder
Recipe recipe = new Recipe(6, Refinery.class); Recipe recipe = new Recipe(6, Buildings.REFINERY);
recipe.addInput(BlackPowder, 2); recipe.addInput(BlackPowder, 2);
recipe.addInput(HeavyOilResidue, 1); recipe.addInput(HeavyOilResidue, 1);
recipe.addOutput(SmokelessPowder, 2); recipe.addOutput(SmokelessPowder, 2);
@ -800,4 +1014,6 @@ public class Database {
public static Collection<Item> getItems() { public static Collection<Item> getItems() {
return new HashSet<>(items); return new HashSet<>(items);
} }
} }

View File

@ -120,7 +120,7 @@ public class Test {
planFor(Database.AlcladAluminumSheet, 100, "alclad"); planFor(Database.AlcladAluminumSheet, 100, "alclad");
planFor(Database.UraniumFuelRod, 1, "fuelrod"); // planFor(Database.UraniumFuelRod, 1, "fuelrod");
planFor(Database.FusedModularFrame, 100, "fusedFrame"); planFor(Database.FusedModularFrame, 100, "fusedFrame");
planFor(Database.SteelIngot, 100, "steelIngot"); planFor(Database.SteelIngot, 100, "steelIngot");

View File

@ -8,8 +8,14 @@ import java.util.Map;
public abstract class Building { public abstract class Building {
protected Map<Item, Integer> cost; protected Map<Item, Integer> cost;
protected Integer power; protected Integer power;
protected final String name;
public Building() { public Building(String name) {
this.name = name;
cost = new HashMap<>(); cost = new HashMap<>();
} }
public String getName() {
return name;
}
} }

View File

@ -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<Item, Double> consumes;
public PowerGenerationBuilding(String name, int power, Map<Item, Integer> cost, Map<Item, Double> consumes) {
super(name);
this.power = power;
this.cost = cost;
this.consumes = consumes;
}
}

View File

@ -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<Item, Integer> cost){
super(name);
this.power = power;
this.cost = cost;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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<Item, Integer> consumes;
public PowerGenerationBuilding() {
consumes = new HashMap<>();
}
}

View File

@ -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);
}
}

View File

@ -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
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -15,32 +15,32 @@ public class Recipe {
private final Map<Item, Double> inputs; private final Map<Item, Double> inputs;
private final Map<Item, Double> outputs; private final Map<Item, Double> outputs;
private final int duration; private final int duration;
private final Class<? extends Building> building; private final Building building;
private boolean isHandCraftable = true; private boolean isHandCraftable = true;
private String name; private String name;
public Recipe(int duration, Class<? extends Building> building) { public Recipe(int duration, Building building) {
this(duration, new HashMap<>(), new HashMap<>(), building); this(duration, new HashMap<>(), new HashMap<>(), building);
} }
public Recipe(int duration, boolean isHandCraftable, Class<? extends Building> building) { public Recipe(int duration, boolean isHandCraftable, Building building) {
this(duration, building); this(duration, building);
this.isHandCraftable = isHandCraftable; this.isHandCraftable = isHandCraftable;
} }
public Recipe(int duration, Item item, int input, Class<? extends Building> building) { public Recipe(int duration, Item item, int input, Building building) {
this(duration, building); this(duration, building);
addInput(item, input); addInput(item, input);
} }
public Recipe(int duration, Map<Item, Double> inputs, Map<Item, Double> outputs, Class<? extends Building> building) { public Recipe(int duration, Map<Item, Double> inputs, Map<Item, Double> outputs, Building building) {
this.duration = duration; this.duration = duration;
this.inputs = inputs; this.inputs = inputs;
this.outputs = outputs; this.outputs = outputs;
this.building = building; this.building = building;
} }
public Recipe(int duration, String name, boolean isHandCraftable, Class<? extends Building> building) { public Recipe(int duration, String name, boolean isHandCraftable, Building building) {
this(duration, building); this(duration, building);
this.name = name; this.name = name;
this.isHandCraftable = isHandCraftable; this.isHandCraftable = isHandCraftable;
@ -240,7 +240,7 @@ public class Recipe {
return new SumResult(production, map); return new SumResult(production, map);
} }
public Class<? extends Building> getBuilding() { public Building getBuilding() {
return building; return building;
} }

View File

@ -78,15 +78,15 @@ public class SumResult {
return new SumResult(merge(production, other.getProduction()), map); return new SumResult(merge(production, other.getProduction()), map);
} }
public Map<Class<? extends Building>, Map<Recipe, Double>> getBuildings() { public Map< Building, Map<Recipe, Double>> getBuildings() {
Map<Class<? extends Building>, Map<Recipe, Double>> buildings = new HashMap<>(); Map<Building, Map<Recipe, Double>> buildings = new HashMap<>();
for (Item item : production.vertexSet()) { for (Item item : production.vertexSet()) {
double n = 0.0; double n = 0.0;
for (ProductionEdge edge : production.outgoingEdgesOf(item)) { for (ProductionEdge edge : production.outgoingEdgesOf(item)) {
n += edge.getInstances(); n += edge.getInstances();
} }
Recipe recipe = item.getRecipe(); Recipe recipe = item.getRecipe();
Class<? extends Building> building = recipe.getBuilding(); Building building = recipe.getBuilding();
HashMap<Recipe, Double> value = (HashMap<Recipe, Double>) buildings.getOrDefault(building, new HashMap<>()); HashMap<Recipe, Double> value = (HashMap<Recipe, Double>) buildings.getOrDefault(building, new HashMap<>());
value.put(recipe, value.getOrDefault(recipe, 0.0) + n); value.put(recipe, value.getOrDefault(recipe, 0.0) + n);
@ -95,9 +95,9 @@ public class SumResult {
return buildings; return buildings;
} }
public static String format(Map<Class<? extends Building>, Map<Recipe, Double>> buildings){ public static String format(Map< Building, Map<Recipe, Double>> buildings){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (Map.Entry<Class<? extends Building>, Map<Recipe, Double>> entry : buildings.entrySet()) { for (Map.Entry< Building, Map<Recipe, Double>> entry : buildings.entrySet()) {
double sum = 0.0; double sum = 0.0;
StringBuilder internal = new StringBuilder(); StringBuilder internal = new StringBuilder();
for (Map.Entry<Recipe, Double> recipes : entry.getValue().entrySet()) { for (Map.Entry<Recipe, Double> recipes : entry.getValue().entrySet()) {