Rename ship/station scrap drop entities to "debris"

This commit is contained in:
2026-07-23 20:51:05 +02:00
parent 11daa61714
commit 8b71fe1a03
48 changed files with 468 additions and 443 deletions

View File

@@ -20,8 +20,8 @@
#include "PositionComponent.h"
#include "RepairSystem.h"
#include "SalvagerSystem.h"
#include "ScrapDataComponent.h"
#include "ScrapSystem.h"
#include "DebrisComponent.h"
#include "DebrisSystem.h"
#include "ShipIdentityComponent.h"
#include "ShipSystem.h"
#include "StateChecksum.h"
@@ -69,7 +69,7 @@ Simulation::Simulation(GameConfig config, unsigned int seed)
m_aiSystem = std::make_unique<AiSystem>(m_config);
m_movementIntentSystem = std::make_unique<MovementIntentSystem>();
m_dynamicBodySystem = std::make_unique<DynamicBodySystem>();
m_scrapSystem = std::make_unique<ScrapSystem>(m_admin);
m_debrisSystem = std::make_unique<DebrisSystem>(m_admin);
m_salvagerSystem = std::make_unique<SalvagerSystem>(m_admin);
m_repairSystem = std::make_unique<RepairSystem>(m_admin);
m_waveSystem = std::make_unique<WaveSystem>(m_config, m_rng);
@@ -141,7 +141,7 @@ void Simulation::reset(unsigned int seed)
m_aiSystem = std::make_unique<AiSystem>(m_config);
m_movementIntentSystem = std::make_unique<MovementIntentSystem>();
m_dynamicBodySystem = std::make_unique<DynamicBodySystem>();
m_scrapSystem = std::make_unique<ScrapSystem>(m_admin);
m_debrisSystem = std::make_unique<DebrisSystem>(m_admin);
m_salvagerSystem = std::make_unique<SalvagerSystem>(m_admin);
m_repairSystem = std::make_unique<RepairSystem>(m_admin);
m_waveSystem = std::make_unique<WaveSystem>(m_config, m_rng);
@@ -329,10 +329,10 @@ void Simulation::tick()
m_shipSystem->clearMovementIntents();
// Score-based behavior selection: evaluate, select winner, execute (sets
// movement intent + preferred module targets only — no world mutation).
m_aiSystem->tick(m_admin, *m_buildingSystem, *m_scrapSystem);
m_aiSystem->tick(m_admin, *m_buildingSystem, *m_debrisSystem);
// Module systems perform the world mutation (collection/delivery, healing).
// Each emits its tool beams and applies its own delayed (mid-beam) effects.
m_salvagerSystem->tick(m_currentTick, *m_scrapSystem, *m_buildingSystem, m_beamFiredEvents);
m_salvagerSystem->tick(m_currentTick, *m_debrisSystem, *m_buildingSystem, m_beamFiredEvents);
m_repairSystem->tick(m_currentTick, m_beamFiredEvents);
// Step 8: combat resolution
@@ -352,8 +352,8 @@ void Simulation::tick()
m_movementIntentSystem->tick(m_admin);
m_dynamicBodySystem->tick(m_admin);
// Step 11: scrap despawn
m_scrapSystem->tickDespawn(m_currentTick);
// Step 11: debris despawn
m_debrisSystem->tickDespawn(m_currentTick);
++m_currentTick;
}
@@ -542,8 +542,8 @@ void Simulation::tickDeathsAndLoot()
if (si.scrapDrop > 0)
{
const Tick despawnAt = m_currentTick
+ secondsToTicks(m_config.world.scrapDespawnSeconds);
m_scrapSystem->spawn(pos.value, si.scrapDrop, despawnAt);
+ secondsToTicks(m_config.world.debrisDespawnSeconds);
m_debrisSystem->spawn(pos.value, si.scrapDrop, despawnAt);
}
m_shipSystem->despawn(deadEntity);
}
@@ -567,7 +567,7 @@ void Simulation::tickDeathsAndLoot()
const FactionComponent& fac = m_admin.get<FactionComponent>(deadEntity);
const Tick despawnAt = m_currentTick
+ secondsToTicks(m_config.world.scrapDespawnSeconds);
+ secondsToTicks(m_config.world.debrisDespawnSeconds);
int scrap = 0;
if (!fac.isEnemy)
{
@@ -584,7 +584,7 @@ void Simulation::tickDeathsAndLoot()
}
if (scrap > 0)
{
m_scrapSystem->spawn(pos.value, scrap, despawnAt);
m_debrisSystem->spawn(pos.value, scrap, despawnAt);
}
m_buildingSystem->unregisterTileOccupancy(sb.bodyCells);
{
@@ -1000,8 +1000,8 @@ unsigned long long Simulation::computeStateChecksum() const
hasher.append(c.linearAcceleration_tptt);
hasher.append(c.angularAcceleration_rptt);
});
m_admin.forEach<ScrapDataComponent>(
[&hasher](entt::entity entity, const ScrapDataComponent& c)
m_admin.forEach<DebrisComponent>(
[&hasher](entt::entity entity, const DebrisComponent& c)
{
hasher.append(static_cast<std::uint32_t>(entity));
hasher.append(c.amount);
@@ -1238,14 +1238,14 @@ const ShipSystem& Simulation::getShips() const
return *m_shipSystem;
}
ScrapSystem& Simulation::getScraps()
DebrisSystem& Simulation::getDebrisSystem()
{
return *m_scrapSystem;
return *m_debrisSystem;
}
const ScrapSystem& Simulation::getScraps() const
const DebrisSystem& Simulation::getDebrisSystem() const
{
return *m_scrapSystem;
return *m_debrisSystem;
}
EntityAdmin& Simulation::getAdmin()