| 162 | } |
| 163 | |
| 164 | MaaController* MaaReplayControllerCreate(const char* recording_path) |
| 165 | { |
| 166 | LogFunc << VAR(recording_path); |
| 167 | |
| 168 | if (!recording_path) { |
| 169 | LogError << "recording_path is null"; |
| 170 | return nullptr; |
| 171 | } |
| 172 | |
| 173 | auto control_unit = MAA_NS::ReplayControlUnitLibraryHolder::create_control_unit(recording_path); |
| 174 | |
| 175 | if (!control_unit) { |
| 176 | LogError << "Failed to create control unit"; |
| 177 | return nullptr; |
| 178 | } |
| 179 | |
| 180 | return new MAA_CTRL_NS::ControllerAgent(std::move(control_unit)); |
| 181 | } |
| 182 | |
| 183 | MaaController* MaaRecordControllerCreate(MaaController* inner, const char* recording_path) |
| 184 | { |
no test coverage detected