#pragma once #include #include #include #include #include #include #include "BuildingType.h" #include "BuildingId.h" #include "entt/entity/entity.hpp" #include "Item.h" #include "ItemType.h" #include "Port.h" #include "Rotation.h" #include "ShipLayout.h" #include "Tick.h" // Per-material input buffer for a production building. struct InputBuffer { std::map counts; // current item counts per material std::map caps; // max items per material (2× per-cycle requirement) }; // Output buffer shared by all output materials for a production building. struct OutputBuffer { std::vector items; int capacity = 0; // 2× per-cycle output; 1× for ReprocessingPlant }; // Active production cycle for a building. struct Production { std::string recipeId; Tick completesAt = 0; std::vector chosenOutputs; // resolved at cycle start (reprocessing rolls here) }; // A building placed on the map that is still under construction. // Occupies tiles but does not produce. struct ConstructionSite { BuildingId id = kInvalidBuildingId; QPoint anchor; // top-left of body bounding box QSize footprint; std::vector bodyCells; // absolute world tile coordinates Rotation rotation = Rotation::East; BuildingType type = BuildingType::Miner; std::string recipeId; // may be configured before completion Tick completesAt = 0; // 0 = queued but not yet started std::optional shipLayout; }; // A fully constructed, operational building. struct Building { BuildingId id = kInvalidBuildingId; QPoint anchor; // top-left of body bounding box QSize footprint; Rotation rotation = Rotation::East; BuildingType type = BuildingType::Miner; std::string recipeId; // empty = none selected InputBuffer inputBuffer; OutputBuffer outputBuffer; std::optional production; // Pre-computed from surface mask at placement; in absolute world coordinates. std::vector bodyCells; std::vector outputPorts; std::vector inputPorts; // perimeter tiles (minus output-port tiles), // direction pointing INTO building // Module layout for shipyards (REQ-MOD-LAYOUT). std::optional shipLayout; };