drop CombatSystem's unused BuildingSystem parameter
This commit is contained in:
@@ -329,7 +329,7 @@ void ArenaSimulation::tick()
|
||||
m_repairSystem->tick(m_currentTick, beamFiredEvents);
|
||||
|
||||
// Combat resolution (tick step 8).
|
||||
m_combatSystem->tick(m_currentTick, m_admin, *m_buildingSystem, beamFiredEvents);
|
||||
m_combatSystem->tick(m_currentTick, m_admin, beamFiredEvents);
|
||||
m_beamFiredEvents.insert(m_beamFiredEvents.end(), beamFiredEvents.begin(), beamFiredEvents.end());
|
||||
m_combatSystem->applyPendingDamage(m_currentTick, m_admin);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ CombatSystem::CombatSystem(const GameConfig& config)
|
||||
|
||||
void CombatSystem::tick(Tick currentTick,
|
||||
EntityAdmin& admin,
|
||||
BuildingSystem& /*buildings*/,
|
||||
std::vector<BeamFiredEvent>& outBeamFiredEvents)
|
||||
{
|
||||
TRACE();
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "entt/entity/entity.hpp"
|
||||
|
||||
class BuildingSystem;
|
||||
class EntityAdmin;
|
||||
|
||||
class CombatSystem
|
||||
@@ -25,7 +24,6 @@ public:
|
||||
|
||||
void tick(Tick currentTick,
|
||||
EntityAdmin& admin,
|
||||
BuildingSystem& buildings,
|
||||
std::vector<BeamFiredEvent>& outBeamFiredEvents);
|
||||
|
||||
void applyPendingDamage(Tick currentTick, EntityAdmin& admin);
|
||||
|
||||
@@ -267,8 +267,7 @@ void Simulation::tick()
|
||||
m_repairSystem->tick(m_currentTick, m_beamFiredEvents);
|
||||
|
||||
// Step 8: combat resolution
|
||||
m_combatSystem->tick(m_currentTick, m_admin,
|
||||
*m_buildingSystem, m_beamFiredEvents);
|
||||
m_combatSystem->tick(m_currentTick, m_admin, m_beamFiredEvents);
|
||||
|
||||
// Step 8b: deferred damage whose impact tick has arrived
|
||||
m_combatSystem->applyPendingDamage(m_currentTick, m_admin);
|
||||
|
||||
@@ -112,7 +112,7 @@ TEST_CASE("CombatSystem: ship fires when cooldown=0 and target in range", "[comb
|
||||
const float hpBefore = f.admin.get<HealthComponent>(player).hp;
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
f.combat.applyPendingDamage(5, f.admin);
|
||||
|
||||
REQUIRE(f.admin.get<HealthComponent>(player).hp < hpBefore);
|
||||
@@ -145,13 +145,13 @@ TEST_CASE("CombatSystem: cooldown prevents firing before it expires", "[combat]"
|
||||
};
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
REQUIRE_FALSE(enemyFiredIn(events));
|
||||
|
||||
f.combat.tick(1, f.admin, f.buildings, events);
|
||||
f.combat.tick(1, f.admin, events);
|
||||
REQUIRE_FALSE(enemyFiredIn(events));
|
||||
|
||||
f.combat.tick(2, f.admin, f.buildings, events);
|
||||
f.combat.tick(2, f.admin, events);
|
||||
REQUIRE(enemyFiredIn(events));
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ TEST_CASE("CombatSystem: no fire when target is out of range", "[combat]")
|
||||
f.wireEnemyTarget(enemy, player);
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
REQUIRE(events.empty());
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ TEST_CASE("CombatSystem: damage not applied before impact tick", "[combat]")
|
||||
const float hpBefore = f.admin.get<HealthComponent>(player).hp;
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
|
||||
for (Tick t = 1; t < 5; ++t)
|
||||
{
|
||||
@@ -331,7 +331,7 @@ TEST_CASE("CombatSystem: damage applied exactly at impact tick", "[combat]")
|
||||
const float hpBefore = f.admin.get<HealthComponent>(player).hp;
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
f.combat.applyPendingDamage(5, f.admin);
|
||||
|
||||
REQUIRE(f.admin.get<HealthComponent>(player).hp < hpBefore);
|
||||
@@ -348,7 +348,7 @@ TEST_CASE("CombatSystem: damage silently dropped if target already dead", "[comb
|
||||
f.wireEnemyTarget(enemy, player);
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
|
||||
f.ships.despawn(player);
|
||||
|
||||
@@ -371,7 +371,7 @@ TEST_CASE("CombatSystem: damage still applied if shooter already dead", "[combat
|
||||
const float hpBefore = f.admin.get<HealthComponent>(player).hp;
|
||||
|
||||
std::vector<BeamFiredEvent> events;
|
||||
f.combat.tick(0, f.admin, f.buildings, events);
|
||||
f.combat.tick(0, f.admin, events);
|
||||
|
||||
f.ships.despawn(enemy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user