Add deconstruction queue

This commit is contained in:
2026-07-22 21:37:56 +02:00
parent a9082c57f3
commit b2ce20e6ad
17 changed files with 551 additions and 85 deletions

View File

@@ -139,9 +139,14 @@ private:
// Returns the new entity id, or nullopt if blocks are insufficient.
std::optional<BuildingId> tryPlaceBuilding(BuildingType type, QPoint anchor, Rotation rotation);
// Demolishes the building with the given id and refunds building blocks.
// Marks the building with the given id for demolition: a construction site is
// removed instantly (full refund), a built building is queued for timed
// deconstruction (REQ-BLD-DECON-QUEUE), refunded on completion.
void demolish(BuildingId id);
// Takes a queued building back out of the deconstruction queue (REQ-BLD-DECON-QUEUE).
void cancelDeconstruction(BuildingId id);
// Applies the player's chosen schematic from the pending choices.
// choiceIndex must be in [0, pendingChoices.size()).
// Clears the pending choices after application.