rename blueprint to schematic
This commit is contained in:
@@ -221,7 +221,7 @@ TEST_CASE("CombatSystem: player station fires at enemy ship in range", "[combat]
|
||||
}
|
||||
}
|
||||
|
||||
// Find a combat ship blueprint for the enemy.
|
||||
// Find a combat ship schematic for the enemy.
|
||||
const ShipDef* combatDef = findCombatShip(sim.config());
|
||||
REQUIRE(combatDef != nullptr);
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ static GameConfig loadConfig()
|
||||
return ConfigLoader::loadFromDirectory(DOTA_FACTORY_CONFIG_DIR);
|
||||
}
|
||||
|
||||
static const ShipDef* findAvailableBlueprint(const GameConfig& cfg)
|
||||
static const ShipDef* findAvailableSchematic(const GameConfig& cfg)
|
||||
{
|
||||
for (const ShipDef& def : cfg.ships.ships)
|
||||
{
|
||||
if (def.availableFromStart && !def.blueprint.materials.empty())
|
||||
if (def.availableFromStart && !def.schematic.materials.empty())
|
||||
{
|
||||
return &def;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ static void fillMaterials(Simulation& sim, EntityId yardId, const ShipDef& def)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (const RecipeIngredient& ing : def.blueprint.materials)
|
||||
for (const RecipeIngredient& ing : def.schematic.materials)
|
||||
{
|
||||
b.inputBuffer.counts[ItemType{ing.item}] = ing.amount;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
const ShipDef* def = findAvailableSchematic(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
@@ -93,7 +93,7 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
REQUIRE(static_cast<int>(sim.ships().allShips().size()) == shipsBefore);
|
||||
|
||||
// Tick until the cycle completes.
|
||||
const Tick cycleTicks = secondsToTicks(def->blueprint.productionTimeSeconds);
|
||||
const Tick cycleTicks = secondsToTicks(def->schematic.productionTimeSeconds);
|
||||
for (Tick i = 1; i < cycleTicks; ++i)
|
||||
{
|
||||
sim.tick();
|
||||
@@ -107,7 +107,7 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
bool foundPlayerShip = false;
|
||||
for (const Ship& ship : sim.ships().allShips())
|
||||
{
|
||||
if (!ship.isEnemy && ship.blueprintId == def->id)
|
||||
if (!ship.isEnemy && ship.schematicId == def->id)
|
||||
{
|
||||
foundPlayerShip = true;
|
||||
break;
|
||||
@@ -116,7 +116,7 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
REQUIRE(foundPlayerShip);
|
||||
}
|
||||
|
||||
TEST_CASE("Shipyard: does not spawn without a blueprint set", "[shipyard]")
|
||||
TEST_CASE("Shipyard: does not spawn without a schematic set", "[shipyard]")
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
@@ -136,7 +136,7 @@ TEST_CASE("Shipyard: does not spawn with insufficient materials", "[shipyard]")
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
const ShipDef* def = findAvailableSchematic(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
@@ -147,7 +147,7 @@ TEST_CASE("Shipyard: does not spawn with insufficient materials", "[shipyard]")
|
||||
sim.buildings().setRecipe(yardId, def->id);
|
||||
// Materials remain at zero (default after setRecipe); no cycle starts.
|
||||
|
||||
const Tick cycleTicks = secondsToTicks(def->blueprint.productionTimeSeconds);
|
||||
const Tick cycleTicks = secondsToTicks(def->schematic.productionTimeSeconds);
|
||||
for (Tick i = 0; i <= cycleTicks; ++i)
|
||||
{
|
||||
sim.tick();
|
||||
@@ -160,7 +160,7 @@ TEST_CASE("Shipyard: spawns a second ship after materials replenished", "[shipya
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
const ShipDef* def = findAvailableSchematic(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
@@ -168,7 +168,7 @@ TEST_CASE("Shipyard: spawns a second ship after materials replenished", "[shipya
|
||||
const EntityId yardId = placeShipyard(sim, *yardDef);
|
||||
sim.buildings().setRecipe(yardId, def->id);
|
||||
|
||||
const Tick cycleTicks = secondsToTicks(def->blueprint.productionTimeSeconds);
|
||||
const Tick cycleTicks = secondsToTicks(def->schematic.productionTimeSeconds);
|
||||
|
||||
// First cycle: capture count immediately after the spawn tick.
|
||||
fillMaterials(sim, yardId, *def);
|
||||
|
||||
@@ -61,11 +61,11 @@ TEST_CASE("Simulation::drainFireEvents clears queue on drain", "[simulation]")
|
||||
REQUIRE(sim.drainFireEvents().empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Simulation::drainBlueprintDropEvents returns empty initially", "[simulation]")
|
||||
TEST_CASE("Simulation::drainSchematicDropEvents returns empty initially", "[simulation]")
|
||||
{
|
||||
Simulation sim(loadConfig());
|
||||
|
||||
REQUIRE(sim.drainBlueprintDropEvents().empty());
|
||||
REQUIRE(sim.drainSchematicDropEvents().empty());
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -233,8 +233,8 @@ TEST_CASE("WaveSystem: only eligible ships (cost > 0) appear in waves", "[wave]"
|
||||
{
|
||||
if (!s.isEnemy) { continue; }
|
||||
// salvage_ship and repair_ship have cost_formula = "0" and must not spawn.
|
||||
REQUIRE(s.blueprintId != "salvage_ship");
|
||||
REQUIRE(s.blueprintId != "repair_ship");
|
||||
REQUIRE(s.schematicId != "salvage_ship");
|
||||
REQUIRE(s.schematicId != "repair_ship");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ TEST_CASE("WaveSystem: destroying both enemy stations triggers a push", "[wave]"
|
||||
REQUIRE(enemyCount == 2);
|
||||
}
|
||||
|
||||
TEST_CASE("WaveSystem: push emits exactly one BlueprintDropEvent", "[wave]")
|
||||
TEST_CASE("WaveSystem: push emits exactly one SchematicDropEvent", "[wave]")
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
@@ -280,11 +280,11 @@ TEST_CASE("WaveSystem: push emits exactly one BlueprintDropEvent", "[wave]")
|
||||
|
||||
sim.tick();
|
||||
|
||||
const std::vector<BlueprintDropEvent> events = sim.drainBlueprintDropEvents();
|
||||
const std::vector<SchematicDropEvent> events = sim.drainSchematicDropEvents();
|
||||
REQUIRE(events.size() == 1);
|
||||
}
|
||||
|
||||
TEST_CASE("WaveSystem: push blueprint drop awards a known ship id", "[wave]")
|
||||
TEST_CASE("WaveSystem: push schematic drop awards a known ship id", "[wave]")
|
||||
{
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
@@ -297,13 +297,13 @@ TEST_CASE("WaveSystem: push blueprint drop awards a known ship id", "[wave]")
|
||||
});
|
||||
|
||||
sim.tick();
|
||||
const std::vector<BlueprintDropEvent> events = sim.drainBlueprintDropEvents();
|
||||
const std::vector<SchematicDropEvent> events = sim.drainSchematicDropEvents();
|
||||
REQUIRE(events.size() == 1);
|
||||
|
||||
bool validId = false;
|
||||
for (const ShipDef& def : sim.config().ships.ships)
|
||||
{
|
||||
if (def.id == events[0].blueprintId)
|
||||
if (def.id == events[0].schematicId)
|
||||
{
|
||||
validId = true;
|
||||
break;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
id = "interceptor"
|
||||
available_from_start = true
|
||||
|
||||
[ship.blueprint]
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 3}, {item = "circuit_board", amount = 1}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 10
|
||||
@@ -29,7 +29,7 @@ scrap_drop = 2
|
||||
id = "destroyer"
|
||||
available_from_start = true
|
||||
|
||||
[ship.blueprint]
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 5}, {item = "circuit_board", amount = 2}]
|
||||
player_production_level = 5
|
||||
production_time_seconds = 20
|
||||
@@ -56,7 +56,7 @@ scrap_drop = 4
|
||||
id = "salvage_ship"
|
||||
available_from_start = true
|
||||
|
||||
[ship.blueprint]
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 4}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 10
|
||||
@@ -82,7 +82,7 @@ scrap_drop = 2
|
||||
id = "repair_ship"
|
||||
available_from_start = false
|
||||
|
||||
[ship.blueprint]
|
||||
[ship.schematic]
|
||||
materials = [{item = "iron_ingot", amount = 4}, {item = "circuit_board", amount = 2}]
|
||||
player_production_level = 3
|
||||
production_time_seconds = 15
|
||||
|
||||
Reference in New Issue
Block a user