mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
perf: 减少部分传参
[skip changelog]
This commit is contained in:
@@ -80,13 +80,19 @@ bool asst::CopilotTask::set_params(const json::value& params)
|
||||
is_raid = params.get("is_adverse", false);
|
||||
}
|
||||
}
|
||||
bool use_sanity_potion = params.get("use_sanity_potion", false); // 是否吃理智药
|
||||
bool with_formation = params.get("formation", false); // 是否使用自动编队
|
||||
int select_formation = params.get("select_formation", 0); // 选择第几个编队,0为不选择
|
||||
bool add_trust = params.get("add_trust", false); // 是否自动补信赖
|
||||
bool add_user_additional = params.get("add_user_additional", false); // 是否自动补用户自定义干员
|
||||
bool use_sanity_potion = params.get("use_sanity_potion", false); // 是否吃理智药
|
||||
bool with_formation = params.get("formation", false); // 是否使用自动编队
|
||||
int select_formation = params.get("select_formation", 0); // 选择第几个编队,0为不选择
|
||||
bool add_trust = params.get("add_trust", false); // 是否自动补信赖
|
||||
bool add_user_additional = params.contains("user_additional"); // 是否自动补用户自定义干员
|
||||
std::string support_unit_name = params.get("support_unit_name", std::string());
|
||||
|
||||
if (params.contains("add_user_additional")) {
|
||||
Log.warn("================ DEPRECATED ================");
|
||||
Log.warn("`add_user_additional` has been deprecated since v5.1.0-beta.1;");
|
||||
Log.warn("================ DEPRECATED ================");
|
||||
}
|
||||
|
||||
auto filename_opt = params.find<std::string>("filename");
|
||||
if (!filename_opt) {
|
||||
Log.error("CopilotTask set_params failed, stage_name or filename not found");
|
||||
|
||||
Reference in New Issue
Block a user