#pragma once #include "rituals.hpp" #include "config.hpp" #include "dinkyecs.hpp" #include #include "components.hpp" namespace combat { struct Combatant { DinkyECS::Entity entity = DinkyECS::NONE; ai::EntityAI* ai = nullptr; components::Combat* combat = nullptr; }; enum class BattleAction { ATTACK, BLOCK, ESCAPE, OTHER }; struct BattleResult { Combatant state; ai::Action wants_to; BattleAction action; }; struct BattleEngine { std::unordered_map combatants; std::vector pending_actions; void add_enemy(Combatant ba); Combatant& get_enemy(DinkyECS::Entity entity); bool plan(); std::optional next(); void dump(); void set(DinkyECS::Entity entity, const std::string& state, bool setting); void set_all(const std::string& state, bool setting); }; }