Refactored boss fight to pull out the FSM code into boss::Fight.

This commit is contained in:
Zed A. Shaw 2025-09-29 13:19:59 -04:00
parent 3b11ed0a75
commit 61a40ae7cd
11 changed files with 127 additions and 94 deletions

View file

@ -10,7 +10,7 @@ namespace boss {
fmt::println("load it");
}
shared_ptr<boss::UI> System::create_bossfight() {
shared_ptr<boss::Fight> System::create_bossfight() {
auto& level = GameDB::current_level();
auto prev_world = GameDB::current_world();
dbc::check(prev_world != nullptr, "Starter world for boss fights can't be null.");
@ -24,6 +24,6 @@ namespace boss {
auto boss_id = world->entity();
components::configure_entity(*world, boss_id, boss_data["components"]);
return make_shared<boss::UI>(world, boss_id);
return make_shared<boss::Fight>(world, boss_id);
}
}