Rename Demolish to Deconstruct
This commit is contained in:
@@ -266,7 +266,7 @@ TEST_CASE("BuildingSystem: placed building enters construction queue", "[buildin
|
||||
REQUIRE(bs.findSite(id) != nullptr);
|
||||
}
|
||||
|
||||
TEST_CASE("BuildingSystem: demolishing a construction site removes it instantly with full refund",
|
||||
TEST_CASE("BuildingSystem: deconstructing a construction site removes it instantly with full refund",
|
||||
"[building]")
|
||||
{
|
||||
PlacementFixture f;
|
||||
@@ -274,8 +274,8 @@ TEST_CASE("BuildingSystem: demolishing a construction site removes it instantly
|
||||
f.bs.place(BuildingType::Miner, QPoint(0, 0), Rotation::East, 0).value();
|
||||
|
||||
// Still queued for construction (not yet built): instant removal, full cost
|
||||
// refunded immediately, never entering the deconstruction queue (REQ-BLD-DEMOLISH).
|
||||
const int refund = f.bs.demolish(id, 0);
|
||||
// refunded immediately, never entering the deconstruction queue (REQ-BLD-DECONSTRUCT).
|
||||
const int refund = f.bs.deconstruct(id, 0);
|
||||
|
||||
REQUIRE(refund == 15); // Miner cost = 15
|
||||
REQUIRE_FALSE(f.bs.isTileOccupied(QPoint(0, 0)));
|
||||
@@ -366,7 +366,7 @@ static void runUntilBuilt(PlacementFixture& f, BuildingId id, Tick& tick)
|
||||
REQUIRE(f.bs.findBuilding(id) != nullptr);
|
||||
}
|
||||
|
||||
TEST_CASE("BuildingSystem: demolishing a built building queues it; refund credited on completion",
|
||||
TEST_CASE("BuildingSystem: deconstructing a built building queues it; refund credited on completion",
|
||||
"[building][decon]")
|
||||
{
|
||||
PlacementFixture f;
|
||||
@@ -376,9 +376,9 @@ TEST_CASE("BuildingSystem: demolishing a built building queues it; refund credit
|
||||
Tick tick = 0;
|
||||
runUntilBuilt(f, id, tick);
|
||||
|
||||
// Demolishing a built building returns nothing immediately and queues it,
|
||||
// Deconstructing a built building returns nothing immediately and queues it,
|
||||
// stopping it operating while its tiles stay occupied (REQ-BLD-DECON-QUEUE).
|
||||
const int refund = f.bs.demolish(id, tick);
|
||||
const int refund = f.bs.deconstruct(id, tick);
|
||||
REQUIRE(refund == 0);
|
||||
REQUIRE(f.bs.isQueuedForDeconstruction(id));
|
||||
REQUIRE(f.bs.isTileOccupied(QPoint(0, 0)));
|
||||
@@ -403,8 +403,8 @@ TEST_CASE("BuildingSystem: deconstruction queue removes one building at a time",
|
||||
runUntilBuilt(f, b, tick);
|
||||
|
||||
// Queue both in one tick; 'a' is at the front of the deconstruction queue.
|
||||
f.bs.demolish(a, tick);
|
||||
f.bs.demolish(b, tick);
|
||||
f.bs.deconstruct(a, tick);
|
||||
f.bs.deconstruct(b, tick);
|
||||
REQUIRE(f.bs.isQueuedForDeconstruction(a));
|
||||
REQUIRE(f.bs.isQueuedForDeconstruction(b));
|
||||
|
||||
@@ -432,7 +432,7 @@ TEST_CASE("BuildingSystem: cancelling deconstruction resumes the building with n
|
||||
Tick tick = 0;
|
||||
runUntilBuilt(f, id, tick);
|
||||
|
||||
f.bs.demolish(id, tick);
|
||||
f.bs.deconstruct(id, tick);
|
||||
REQUIRE(f.bs.isQueuedForDeconstruction(id));
|
||||
|
||||
// Un-queue before it drains: it operates again, no refund, tiles still occupied.
|
||||
@@ -460,7 +460,7 @@ TEST_CASE("BuildingSystem: queued belt stops transporting; cancel restores it",
|
||||
|
||||
// Queuing a belt unregisters its tile from the belt subsystem, so it no longer
|
||||
// accepts or transports items, though the tile stays occupied (REQ-BLD-DECON-QUEUE).
|
||||
f.bs.demolish(id, tick);
|
||||
f.bs.deconstruct(id, tick);
|
||||
REQUIRE_FALSE(f.belts.tryPutItem(QPoint(0, 0), makeItem("iron_ore"), Rotation::East));
|
||||
REQUIRE(f.bs.isTileOccupied(QPoint(0, 0)));
|
||||
|
||||
@@ -482,7 +482,7 @@ TEST_CASE("BuildingSystem: splitter filters survive a queue/un-queue round-trip"
|
||||
|
||||
// Queue: the belt subsystem tile (and its filters) are unregistered, but the
|
||||
// filters are captured so an un-queue can restore them.
|
||||
f.bs.demolish(id, tick);
|
||||
f.bs.deconstruct(id, tick);
|
||||
REQUIRE_FALSE(f.belts.getSplitterInfo(QPoint(0, 0)).has_value());
|
||||
|
||||
f.bs.cancelDeconstruction(id);
|
||||
|
||||
Reference in New Issue
Block a user