Simple battle system included in the boss fight but I need to figure out how it should operate.

This commit is contained in:
Zed A. Shaw 2025-11-19 13:26:21 -05:00
parent d418f073f0
commit 8ee3e8736f
8 changed files with 75 additions and 17 deletions

View file

@ -40,13 +40,13 @@ namespace combat {
}
}
void BattleEngine::set(DinkyECS::Entity entity, std::string state, bool setting) {
void BattleEngine::set(DinkyECS::Entity entity, const std::string& state, bool setting) {
dbc::check(combatants.contains(entity), "invalid combatant given to BattleEngine");
auto& action = combatants.at(entity);
action.ai.set_state(state, setting);
}
void BattleEngine::set_all(std::string state, bool setting) {
void BattleEngine::set_all(const std::string& state, bool setting) {
for(auto& [ent, action] : combatants) {
action.ai.set_state(state, setting);
}