#pragma once #include #include #include #include "BuildingType.h" // One entry in [[recipe]].inputs — amount units of a named item consumed per // production cycle (REQ-MAT-CYCLE). struct RecipeIngredient { std::string item; int amount; }; // One entry in [[recipe]].outputs. For reprocessing_plant recipes, probability // is populated and outputs are rolled with weighted pick at cycle start // (REQ-BLD-REPROCESSING, REQ-MAT-CYCLE). For other buildings, probability is // std::nullopt and all outputs are produced on every cycle. struct RecipeOutput { std::string item; int amount; std::optional probability; }; struct RecipeDef { std::string id; // Unique recipe id; used by UI for selection. BuildingType building; // Which BuildingType can run this recipe. std::vector inputs; std::vector outputs; double durationSeconds; // Assembler only. nullopt = implicit-only locking. -1 = explicitly unlocked // at game start. >= 0 = locked; schematic enters drop pool at that station // level once the output item is implicitly unlocked (REQ-LOCK-EXPLICIT). std::optional unlockAtStationLevel; // Assembler recipe schematics only. Prerequisite schematic ids that must be // explicitly unlocked before this schematic can enter the drop pool // (REQ-LOCK-PREREQ). Empty = none. std::vector unlockRequires; }; struct RecipesConfig { std::vector recipes; };