#pragma once #include #include #include #include #include "Port.h" #include "Rotation.h" // Parsed representation of a building's surface_mask after applying rotation. // All coordinates are relative to the building's anchor tile (the point passed // to BuildingSystem::place), which corresponds to (0,0) in this system. struct ParsedSurfaceMask { QSize footprint; // bounding box of body cells (A + S tiles) std::vector bodyCells; // relative positions of A and S tiles std::vector outputPorts; // port.tile = cell adjacent to body, outside footprint; // port.direction = flow direction away from building std::vector shipDockCells; // relative positions of S tiles (subset of bodyCells) }; // Parse a surface_mask definition (as loaded from TOML) and apply the given // rotation. The canonical mask orientation corresponds to Rotation::East. // Rotations are applied clockwise (East=0, South=90°, West=180°, North=270°). ParsedSurfaceMask parseSurfaceMask(const std::vector& rows, Rotation rotation);