testing
This commit is contained in:
193
vanilla.py
193
vanilla.py
@@ -1,20 +1,68 @@
|
||||
from enum import Enum
|
||||
from typing import Dict
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from shared import Machine, Item
|
||||
|
||||
class Machines(Enum):
|
||||
Smelter = Machine(name="Smelter")
|
||||
Constructor = Machine(name="Constructor")
|
||||
Assembler = Machine(name="Assembler")
|
||||
Foundry = Machine(name="Foundry")
|
||||
Manufacturer = Machine(name="Manufacturer")
|
||||
Blender = Machine(name="Blender")
|
||||
Refinery = Machine(name="Refinery")
|
||||
|
||||
|
||||
class Items(Enum):
|
||||
IronIngot = Item(name="Iron Ingot")
|
||||
CopperIngot = Item(name="Copper Ingot")
|
||||
Limestone = Item(name="Limestone")
|
||||
IronOre = Item(name="Iron Ore")
|
||||
CopperOre = Item(name="Copper Ore")
|
||||
IronPlate = Item(name="Iron Plate")
|
||||
IronRod = Item(name="Iron Rod")
|
||||
Wire = Item(name="Wire")
|
||||
Cable = Item(name="Cable")
|
||||
Concrete = Item(name="Concrete")
|
||||
Screw = Item(name="Screw")
|
||||
ReinforcedIronPlate = Item(name="Reinforced Iron Plate")
|
||||
ModularFrame = Item(name="Modular Frame")
|
||||
HeavyModularFrame = Item(name="Heavy Modular Frame")
|
||||
EncasedIndustrialBeam = Item(name="Encased Industrial Beam")
|
||||
SteelPipe = Item(name="Steel Pipe")
|
||||
SteelBeam = Item(name="Steel Beam")
|
||||
SteelIngot = Item(name="Steel Ingot")
|
||||
Coal = Item(name="Coal")
|
||||
FusedModularFrame = Item(name="Fused Modular Frame")
|
||||
NitrogenGas = Item(name="Nitrogen Gas")
|
||||
AluminumCasing = Item(name="Aluminum Casing")
|
||||
AluminumIngot = Item(name="Aluminum Ingot")
|
||||
Silica = Item(name="Silica")
|
||||
AluminumScrap = Item(name="Aluminum Scrap")
|
||||
AluminaSolution = Item(name="Alumina Solution")
|
||||
Water = Item(name="Water")
|
||||
RawQuartz = Item(name="Raw Quartz")
|
||||
Bauxite = Item(name="Bauxite")
|
||||
|
||||
class RawResources(Enum):
|
||||
Water = Items.Water
|
||||
Coal = Items.Coal
|
||||
IronOre = Items.IronOre
|
||||
CopperOre = Items.CopperOre
|
||||
Limestone = Items.Limestone
|
||||
NitrogenGas = Items.NitrogenGas
|
||||
RawQuartz = Items.RawQuartz
|
||||
Bauxite = Items.Bauxite
|
||||
|
||||
class Recipe(BaseModel):
|
||||
name: str
|
||||
building: Machines
|
||||
outputs: Dict[Items, float]
|
||||
inputs: Dict[Items, float] = Field(default_factory=dict)
|
||||
byproducts: Dict[Items, float] = Field(default_factory=dict)
|
||||
|
||||
class Recipes(Enum):
|
||||
# Mining
|
||||
IronOre = Recipe(
|
||||
name="Iron Ore",
|
||||
building=Machines.Miner,
|
||||
outputs={Items.IronOre: 60.0},
|
||||
)
|
||||
CopperOre = Recipe(
|
||||
name="Copper Ore",
|
||||
building=Machines.Miner,
|
||||
outputs={Items.CopperOre: 60.0},
|
||||
)
|
||||
Limestone = Recipe(
|
||||
name="Limestone",
|
||||
building=Machines.Miner,
|
||||
outputs={Items.Limestone: 60.0},
|
||||
)
|
||||
# Smelting
|
||||
IronIngot = Recipe(
|
||||
name="Iron Ingot",
|
||||
@@ -76,4 +124,117 @@ class Recipes(Enum):
|
||||
Items.IronPlate: 30.0,
|
||||
Items.Screw: 60.0,
|
||||
},
|
||||
)
|
||||
ModularFrame = Recipe(
|
||||
name="Modular Frame",
|
||||
building=Machines.Assembler,
|
||||
outputs={Items.ModularFrame: 2.0},
|
||||
inputs={
|
||||
Items.IronRod: 12.0,
|
||||
Items.ReinforcedIronPlate: 3.0,
|
||||
},
|
||||
)
|
||||
HeavyModularFrame = Recipe(
|
||||
name="Heavy Modular Frame",
|
||||
building=Machines.Manufacturer,
|
||||
outputs={Items.HeavyModularFrame: 2.0},
|
||||
inputs={
|
||||
Items.SteelPipe: 40.0,
|
||||
Items.Screw: 240.0,
|
||||
Items.EncasedIndustrialBeam: 10.0,
|
||||
Items.ModularFrame: 10.0,
|
||||
},
|
||||
)
|
||||
EncasedIndustrialBeam = Recipe(
|
||||
name="Encased Industrial Beam",
|
||||
building=Machines.Assembler,
|
||||
outputs={Items.EncasedIndustrialBeam: 6.0},
|
||||
inputs={
|
||||
Items.Concrete: 36.0,
|
||||
Items.SteelBeam: 18.0,
|
||||
},
|
||||
)
|
||||
SteelPipe = Recipe(
|
||||
name="Steel Pipe",
|
||||
building=Machines.Constructor,
|
||||
outputs={Items.SteelPipe: 20.0},
|
||||
inputs={
|
||||
Items.SteelIngot: 30.0
|
||||
},
|
||||
)
|
||||
SteelBeam = Recipe(
|
||||
name="Steel Beam",
|
||||
building=Machines.Constructor,
|
||||
outputs={Items.SteelBeam: 15.0},
|
||||
inputs={
|
||||
Items.SteelIngot: 60.0
|
||||
},
|
||||
)
|
||||
SteelIngot = Recipe(
|
||||
name="Steel Ingot",
|
||||
building=Machines.Foundry,
|
||||
outputs={Items.SteelIngot: 45.0},
|
||||
inputs={
|
||||
Items.Coal: 45.0,
|
||||
Items.IronOre: 45.0,
|
||||
}
|
||||
)
|
||||
FusedModularFrame = Recipe(
|
||||
name="Fused Modular Frame",
|
||||
building=Machines.Blender,
|
||||
outputs={Items.FusedModularFrame: 1.5},
|
||||
inputs={
|
||||
Items.NitrogenGas: 37.5,
|
||||
Items.AluminumCasing: 75.0,
|
||||
Items.HeavyModularFrame: 1.5,
|
||||
},
|
||||
)
|
||||
AluminumCasing = Recipe(
|
||||
name="Aluminum Casing",
|
||||
building=Machines.Constructor,
|
||||
outputs={Items.AluminumCasing: 60.0},
|
||||
inputs={
|
||||
Items.AluminumIngot: 90.0,
|
||||
},
|
||||
)
|
||||
AluminumIngot = Recipe(
|
||||
name="Aluminum Ingot",
|
||||
building=Machines.Foundry,
|
||||
outputs={Items.AluminumIngot: 60.0},
|
||||
inputs={
|
||||
Items.Silica: 75.0,
|
||||
Items.AluminumScrap: 90.0,
|
||||
}
|
||||
)
|
||||
AluminumScrap = Recipe(
|
||||
name="Aluminum Scrap",
|
||||
building=Machines.Refinery,
|
||||
outputs={
|
||||
Items.AluminumScrap: 360.0
|
||||
},
|
||||
inputs={
|
||||
Items.Coal: 120.0,
|
||||
Items.AluminaSolution: 240.0,
|
||||
},
|
||||
byproducts={Items.Water: 120.0}
|
||||
)
|
||||
Silica = Recipe(
|
||||
name="Silica",
|
||||
building=Machines.Constructor,
|
||||
outputs={Items.Silica: 37.5},
|
||||
inputs={
|
||||
Items.RawQuartz: 22.5,
|
||||
}
|
||||
)
|
||||
AluminaSolution = Recipe(
|
||||
name="Alumina Solution",
|
||||
building=Machines.Refinery,
|
||||
outputs={
|
||||
Items.AluminaSolution: 120.0
|
||||
},
|
||||
inputs={
|
||||
Items.Water: 180.0,
|
||||
Items.Bauxite: 120.0,
|
||||
},
|
||||
byproducts={Items.Silica: 50.0}
|
||||
)
|
||||
Reference in New Issue
Block a user