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

@@ -28,6 +28,7 @@ enum class CommandKind
{
PlaceBuilding,
Demolish,
CancelDeconstruction,
RotateInPlace,
SetRecipe,
SetShipLayout,
@@ -72,12 +73,22 @@ struct PlaceBuildingCommand : Command
std::vector<ItemType> splitterFilterB;
};
// Marks a building for demolition: a construction site is removed instantly, a
// built building is queued for deconstruction (REQ-BLD-DEMOLISH, REQ-BLD-DECON-QUEUE).
struct DemolishCommand : Command
{
DemolishCommand() : Command(CommandKind::Demolish) {}
std::optional<BuildingId> id;
};
// Takes a building back out of the deconstruction queue (REQ-BLD-DEMOLISH-CLICK,
// REQ-BLD-DEMOLISH-BOX). No-op if the id is not currently queued.
struct CancelDeconstructionCommand : Command
{
CancelDeconstructionCommand() : Command(CommandKind::CancelDeconstruction) {}
std::optional<BuildingId> id;
};
struct RotateInPlaceCommand : Command
{
RotateInPlaceCommand() : Command(CommandKind::RotateInPlace) {}