#pragma once #include "goap.hpp" #include "ai.hpp" #include "config.hpp" #include #include "dinkyecs.hpp" namespace combat { struct BattleEngine { std::unordered_map combatants; void add_enemy(DinkyECS::Entity enemy_id, ai::EntityAI& enemy); bool plan(); void fight(std::function cb); void dump(); }; struct RitualAI { std::string script; ai::State start; ai::State original; ai::State goal; ai::ActionPlan plan; RitualAI(std::string script, ai::State start, ai::State goal) : script(script), start(start), original(start), goal(goal) { } RitualAI() {}; bool will_do(std::string name); void dump(); ai::Action pop(); }; struct RitualEngine { Config $config; ai::AIProfile $profile; std::unordered_map $actions; std::unordered_map $states; std::unordered_map> $scripts; RitualEngine(std::string config_path); ai::State load_state(std::string name); ai::Action load_action(std::string name); RitualAI start(); void reset(RitualAI& ritual); void set_state(RitualAI& ritual, std::string name, bool setting); void plan(RitualAI& ritual); }; }