rename EntityId to BuildingId
This commit is contained in:
@@ -43,7 +43,7 @@ static const BuildingDef* findShipyardDef(const GameConfig& cfg)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static EntityId placeShipyard(Simulation& sim, const BuildingDef& yardDef)
|
||||
static BuildingId placeShipyard(Simulation& sim, const BuildingDef& yardDef)
|
||||
{
|
||||
return sim.buildings().placeImmediate(
|
||||
BuildingType::Shipyard,
|
||||
@@ -60,7 +60,7 @@ static int countShips(Simulation& sim)
|
||||
return n;
|
||||
}
|
||||
|
||||
static void fillMaterials(Simulation& sim, EntityId yardId, const ShipDef& def)
|
||||
static void fillMaterials(Simulation& sim, BuildingId yardId, const ShipDef& def)
|
||||
{
|
||||
sim.buildings().forEachBuilding([&](Building& b)
|
||||
{
|
||||
@@ -91,8 +91,8 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
|
||||
const int shipsBefore = countShips(sim);
|
||||
|
||||
const EntityId yardId = placeShipyard(sim, *yardDef);
|
||||
REQUIRE(yardId != kInvalidEntityId);
|
||||
const BuildingId yardId = placeShipyard(sim, *yardDef);
|
||||
REQUIRE(yardId != kInvalidBuildingId);
|
||||
|
||||
sim.buildings().setRecipe(yardId, def->id);
|
||||
fillMaterials(sim, yardId, *def);
|
||||
@@ -152,7 +152,7 @@ TEST_CASE("Shipyard: does not spawn with insufficient materials", "[shipyard]")
|
||||
|
||||
const int shipsBefore = countShips(sim);
|
||||
|
||||
const EntityId yardId = placeShipyard(sim, *yardDef);
|
||||
const BuildingId yardId = placeShipyard(sim, *yardDef);
|
||||
sim.buildings().setRecipe(yardId, def->id);
|
||||
// Materials remain at zero (default after setRecipe); no cycle starts.
|
||||
|
||||
@@ -174,7 +174,7 @@ TEST_CASE("Shipyard: spawns a second ship after materials replenished", "[shipya
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
|
||||
const EntityId yardId = placeShipyard(sim, *yardDef);
|
||||
const BuildingId yardId = placeShipyard(sim, *yardDef);
|
||||
sim.buildings().setRecipe(yardId, def->id);
|
||||
|
||||
const Tick cycleTicks = secondsToTicks(def->schematic.productionTimeSeconds);
|
||||
|
||||
Reference in New Issue
Block a user