store belts as buildings and fix issue that belts could not be selected
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
|
||||
// Manages building placement, construction queuing, and the per-tick
|
||||
// production loop (belt→building pull, production, building→belt push).
|
||||
// Belt and Splitter types are forwarded to BeltSystem rather than stored
|
||||
// as Building instances.
|
||||
// All types including Belt and Splitter are stored as Building instances;
|
||||
// BeltSystem owns the per-tile simulation data (item slots, flow).
|
||||
class BuildingSystem
|
||||
{
|
||||
public:
|
||||
@@ -106,14 +106,6 @@ public:
|
||||
void forEachBuilding(std::function<void(Building&)> fn);
|
||||
|
||||
private:
|
||||
struct BeltEntry
|
||||
{
|
||||
QPoint tile;
|
||||
BuildingType type; // Belt or Splitter
|
||||
Rotation directionA; // Belt: its direction; Splitter: first output
|
||||
Rotation directionB; // Splitter: second output; Belt: same as directionA
|
||||
};
|
||||
|
||||
const BuildingDef* findBuildingDef(BuildingType type) const;
|
||||
const RecipeDef* findRecipe(const std::string& id, BuildingType type) const;
|
||||
const ShipDef* findShipDef(const std::string& id) const;
|
||||
@@ -131,7 +123,6 @@ private:
|
||||
|
||||
std::vector<Building> m_buildings;
|
||||
std::deque<ConstructionSite> m_constructionQueue;
|
||||
std::map<EntityId, BeltEntry> m_beltEntities;
|
||||
|
||||
// Maps every occupied body-cell coordinate to the entity that owns it.
|
||||
std::map<std::pair<int, int>, EntityId> m_tileOccupancy;
|
||||
|
||||
Reference in New Issue
Block a user