#include "rituals.hpp" #include "ai_debug.hpp" namespace combat { void RitualAI::reset() { start = original; } bool RitualAI::will_do(std::string name) { ai::check_valid_action(name, "RitualAI::is_able_to"); return plan.script[0].name == name; } void RitualAI::set_state(std::string name, bool setting) { ai::set(start, name, setting); } /* * BUG: I don't like this, maybe an iterator is better? */ ai::Action RitualAI::pop() { auto result = plan.script.front(); plan.script.pop_front(); return result; } void RitualAI::update() { plan = ai::plan(script, start, goal); } void RitualAI::dump() { ai::dump_script(script, start, plan.script); } }