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

Method generate_runtime_task

source/MaaPiCli/Impl/Configurator.cpp:462–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462std::optional<RuntimeParam::Task> Configurator::generate_runtime_task(const Configuration::Task& config_task) const
463{
464 auto data_iter = std::ranges::find_if(data_.task, [&](const auto& data_task) { return data_task.name == config_task.name; });
465 if (data_iter == data_.task.end()) {
466 LogWarn << "task not found" << VAR(config_task.name);
467 return std::nullopt;
468 }
469 const auto& data_task = *data_iter;
470
471 RuntimeParam::Task runtime_task { .name = data_task.name,
472 .entry = data_task.entry,
473 .pipeline_override = json::array { data_task.pipeline_override } };
474
475 // v2.3.0: merge in priority order (later overrides earlier)
476 // 1. global_option (lowest priority)
477 merge_option_overrides(runtime_task, config_.global_option);
478 // 2. resource.option
479 merge_option_overrides(runtime_task, config_.resource_option);
480 // 3. controller.option
481 merge_option_overrides(runtime_task, config_.controller_option);
482 // 4. task.option (highest priority)
483 merge_option_overrides(runtime_task, config_task.option);
484
485 return runtime_task;
486}
487
488std::string Configurator::detect_system_language() const
489{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected