From 52b0bdaba5b38790d144bf1e800ea34be937ded0 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 4 May 2023 00:07:51 +0200 Subject: Refactored Actions to be owned by registry Registry is now also responsible for switching between the actions and each action is expected to have one system. Technically an std::variant could be used here, but let's wait a bit and see how this part evolves. --- sim/src/BaseSimulation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sim/src/BaseSimulation.cpp') diff --git a/sim/src/BaseSimulation.cpp b/sim/src/BaseSimulation.cpp index 2731c67..ffd43f9 100644 --- a/sim/src/BaseSimulation.cpp +++ b/sim/src/BaseSimulation.cpp @@ -16,6 +16,7 @@ namespace sim BaseSimulation::BaseSimulation(State& ctx) { + setup_ai_components(ctx); manager.extend(ctx); } @@ -24,7 +25,7 @@ void BaseSimulation::operator()(State& ctx) { pick_random_targets(ctx, manager); - take_actions(ctx); + keep_at_range(ctx); FloatingMovement::update(ctx); update_turrets(ctx); shoot_at_targets(ctx); -- cgit v1.1