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

Method parse_multi_swipe

source/MaaFramework/Resource/PipelineParser.cpp:1304–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1302}
1303
1304bool PipelineParser::parse_multi_swipe(
1305 const json::value& input,
1306 Action::MultiSwipeParam& output,
1307 const Action::MultiSwipeParam& default_multi,
1308 const Action::SwipeParam& default_single)
1309{
1310 auto swipes_opt = input.find("swipes");
1311 if (!swipes_opt) {
1312 output = default_multi;
1313 return true;
1314 }
1315
1316 if (!swipes_opt->is_array()) {
1317 LogError << "failed to parse swipes, is not array" << VAR(input);
1318 return false;
1319 }
1320
1321 output.swipes.clear();
1322 for (const json::value& swipe : swipes_opt->as_array()) {
1323 Action::SwipeParam res;
1324 if (!parse_swipe(swipe, res, default_single)) {
1325 return false;
1326 }
1327
1328 output.swipes.emplace_back(std::move(res));
1329 }
1330
1331 return true;
1332}
1333
1334bool PipelineParser::parse_key_param(const json::value& input, Action::KeyParam& output, const Action::KeyParam& default_value)
1335{

Callers

nothing calls this directly

Calls 3

moveFunction · 0.85
findMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected