MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / MaaTaskerPostRecognition

Function MaaTaskerPostRecognition

source/Common/MaaTasker.cpp:154–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154MaaTaskId MaaTaskerPostRecognition(MaaTasker* tasker, const char* reco_type, const char* reco_param, const MaaImageBuffer* image)
155{
156 LogFunc << VAR_VOIDP(tasker) << VAR(reco_type) << VAR(reco_param);
157
158 if (!tasker) {
159 LogError << "handle is null";
160 return MaaInvalidId;
161 }
162
163 if (!reco_type) {
164 LogError << "reco_type is null";
165 return MaaInvalidId;
166 }
167
168 if (!reco_param) {
169 LogError << "reco_param is null";
170 return MaaInvalidId;
171 }
172
173 if (!image) {
174 LogError << "image is null";
175 return MaaInvalidId;
176 }
177
178 auto param_opt = json::parse(reco_param);
179 if (!param_opt) {
180 LogError << "failed to parse" << VAR(reco_param);
181 return MaaInvalidId;
182 }
183
184 return tasker->post_recognition(reco_type, *param_opt, image->get());
185}
186
187MaaTaskId
188 MaaTaskerPostAction(MaaTasker* tasker, const char* action_type, const char* action_param, const MaaRect* box, const char* reco_detail)

Callers 1

post_recognitionMethod · 0.85

Calls 2

post_recognitionMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected