The two executors were line-for-line duplicates: orbit the behavior target, then hand it to the owner's in-range modules. Both now call a templated executeOrbitAndAssign<Behavior, ModuleComponent>; the view types, iteration order, and sequence of component writes are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GH8ZMRY3vhxxXcaUxBqxkk
18 lines
452 B
C++
18 lines
452 B
C++
#include "AttackExecutor.h"
|
|
|
|
#include "AttackBehavior.h"
|
|
#include "BehaviorKind.h"
|
|
#include "EntityAdmin.h"
|
|
#include "OrbitAndAssignExecutor.h"
|
|
#include "tracing.h"
|
|
#include "WeaponComponent.h"
|
|
|
|
void AttackExecutor::execute(EntityAdmin& admin)
|
|
{
|
|
TRACE();
|
|
|
|
// Orbit the attack target and hand it to every weapon that can reach it
|
|
// (REQ-SHP-ORBIT).
|
|
executeOrbitAndAssign<AttackBehavior, WeaponComponent>(admin, BehaviorKind::Attack);
|
|
}
|