| 8 | #include "Resource/ResourceMgr.h" |
| 9 | |
| 10 | MAA_CTRL_NS_BEGIN |
| 11 | |
| 12 | ControllerAgent::ControllerAgent(std::shared_ptr<MAA_CTRL_UNIT_NS::ControlUnitAPI> control_unit) |
| 13 | : control_unit_(std::move(control_unit)) |
| 14 | { |
| 15 | LogFunc << VAR(control_unit_); |
| 16 | |
| 17 | auto& plugin_mgr = MAA_GLOBAL_NS::PluginMgr::get_instance(); |
| 18 | LogInfo << VAR(plugin_mgr.get_names()); |
| 19 | |
| 20 | for (const auto& sink : plugin_mgr.get_ctrl_sinks()) { |
| 21 | add_sink(sink, this); |
| 22 | } |
| 23 | |
| 24 | action_runner_ = |
| 25 | std::make_unique<AsyncRunner<Action>>(std::bind(&ControllerAgent::run_action, this, std::placeholders::_1, std::placeholders::_2)); |
| 26 | } |
| 27 | |
| 28 | ControllerAgent::~ControllerAgent() |
| 29 | { |
nothing calls this directly
no test coverage detected