#pragma once #include #include "BeltSystem.h" #include "Building.h" #include "GameConfig.h" #include "ItemType.h" #include "RecipesConfig.h" // Setting a building up when it starts existing or is reconfigured: sizing its // input/output buffers from what it will produce, and handing belt-like types back // to BeltSystem. Free functions over the config and the building — they read no // factory state, so both BuildingSystem and ConstructionSystem can use them. // Buffers for a building running one known recipe: inputs capped at twice each // ingredient's per-cycle amount, output at twice the per-cycle total (one cycle's // max for a Reprocessing Plant, REQ-MAT-OUTPUT-BUFFER-REPROCESSING). void initBuffers(Building& b, const RecipeDef& recipe); // Buffers for an auto-recipe building (Smelter, Reprocessing Plant), unioned over // every recipe of its type (REQ-BLD-SMELTER, REQ-BLD-REPROCESSING). void initAutoBuffers(const GameConfig& config, Building& b); // Buffers for a shipyard: its schematic's materials plus those of every placed // module (REQ-BLD-SHIPYARD). void initShipyardBuffers(const GameConfig& config, Building& b); // The Salvage Bay holds no recipe inputs; its output capacity is config-defined // (REQ-BLD-SALVAGE-BAY). void initSalvageBayBuffer(const GameConfig& config, Building& b); // Registers a belt, splitter or tunnel end with BeltSystem. A splitter's filters // live in BeltSystem and are lost by removeTile, so they are passed back in // (REQ-BLD-SPLITTER). No-op for every other building type. void reregisterBeltTile(BeltSystem& belts, const GameConfig& config, const Building& building, const std::vector& splitterFilterA, const std::vector& splitterFilterB);