fix: build error from meojson updates

This commit is contained in:
MistEO
2024-02-23 16:21:11 +08:00
parent 2923dad698
commit 8fc10b3a8a
7 changed files with 14 additions and 14 deletions

View File

@@ -157,9 +157,9 @@ bool asst::CombatRecordRecognitionTask::analyze_formation()
std::vector<battle::OperUsage> opers;
opers.emplace_back(battle::OperUsage { name, 0, battle::SkillUsage::NotUse });
json::object oper_json { { "name", name }, { "skill", 0 }, { "skill_usage", 0 } };
m_copilot_json["opers"].array_emplace(std::move(oper_json));
m_copilot_json["opers"].emplace(std::move(oper_json));
cb_formation.array_emplace(name);
cb_formation.emplace(name);
asst::imwrite(utils::path("debug/video_export/formation/") / utils::path(name + ".png"), avatar);
}
callback(AsstMsg::SubTaskCompleted, cb_info);

View File

@@ -342,7 +342,7 @@ bool asst::StageDropsTaskPlugin::upload_to_server(const std::string& subtask, Re
}
json::value format_drop = drop;
format_drop.as_object().erase("itemName");
all_drops.array_emplace(std::move(format_drop));
all_drops.emplace(std::move(format_drop));
}
body["source"] = UploadDataSource;
body["version"] = Version;

View File

@@ -194,7 +194,7 @@ void asst::StageQueueMissionCompletedTaskPlugin::upload_to_penguin(std::string s
}
json::value format_drop = drop;
format_drop.as_object().erase("itemName");
all_drops.array_emplace(std::move(format_drop));
all_drops.emplace(std::move(format_drop));
}
body["source"] = UploadDataSource;
body["version"] = Version;

View File

@@ -777,7 +777,7 @@ void asst::AutoRecruitTask::upload_to_penguin(Rng&& tags)
body["stageId"] = "recruit";
auto& all_drops = body["drops"];
for (const auto& tag : tags) {
all_drops.array_emplace(json::object {
all_drops.emplace(json::object {
{ "dropType", "NORMAL_DROP" },
{ "itemId", tag },
{ "quantity", 1 },

View File

@@ -434,7 +434,7 @@ bool asst::BattleFormationTask::parse_formation()
if (opers_vec.empty()) {
continue;
}
formation.array_emplace(name);
formation.emplace(name);
// 判断干员/干员组的职业,放进对应的分组
bool same_role = true;

View File

@@ -69,7 +69,7 @@ void asst::DepotRecognitionTask::callback_analyze_result(bool done)
auto& arkplanner_data_items = arkplanner_obj["items"];
for (const auto& [item_id, item_info] : m_all_items) {
arkplanner_data_items.array_emplace(json::object {
arkplanner_data_items.emplace(json::object {
{ "id", item_id },
{ "have", item_info.quantity },
{ "name", item_info.item_name },
@@ -83,7 +83,7 @@ void asst::DepotRecognitionTask::callback_analyze_result(bool done)
auto& lolicon = details["lolicon"];
auto& lolicon_obj = lolicon["object"];
for (const auto& [item_id, item_info] : m_all_items) {
lolicon_obj.object_emplace(item_id, item_info.quantity);
lolicon_obj.emplace(item_id, item_info.quantity);
}
lolicon["data"] = lolicon_obj.to_string();
}

View File

@@ -521,8 +521,8 @@ bool update_infrast_data(const std::filesystem::path& input_dir, const std::file
}
}
if (new_name) {
skill["name"].array_emplace(name);
skill["desc"].array_emplace(desc);
skill["name"].emplace(name);
skill["desc"].emplace(desc);
}
// 历史遗留问题以前的图片是从wiki上爬的都是大写开头
@@ -857,7 +857,7 @@ bool update_battle_chars_info(const std::filesystem::path& official_dir, const s
}
}
}
chars.object_emplace(id, std::move(char_new_data));
chars.emplace(id, std::move(char_new_data));
}
for (const auto& [oper_id, token_id_list] : tokens) {
std::vector<std::string> token_names_list;
@@ -880,7 +880,7 @@ bool update_battle_chars_info(const std::filesystem::path& official_dir, const s
Amiya_data["rangeId"] = json::array { "1-1", "1-1", "1-1" };
Amiya_data["rarity"] = 5;
Amiya_data["position"] = "MELEE";
chars.object_emplace("char_1001_amiya2", std::move(Amiya_data));
chars.emplace("char_1001_amiya2", std::move(Amiya_data));
const auto& out_file = output_dir / "battle_data.json";
std::ofstream ofs(out_file, std::ios::out);
@@ -1003,7 +1003,7 @@ bool update_recruitment_data(const std::filesystem::path& input_dir, const std::
return false;
}
opers.array_emplace(json::object { { "id", id },
opers.emplace(json::object { { "id", id },
{ "name", name },
{ "rarity", info_iter->second.rarity },
{ "tags", json::array(info_iter->second.tags) } });
@@ -1024,7 +1024,7 @@ bool update_recruitment_data(const std::filesystem::path& input_dir, const std::
auto& tags = result["tags"];
for (const auto& [id, tag] : tags_name) {
std::string base_name = base_tags_name.at(id);
tags.object_emplace(base_name, tag);
tags.emplace(base_name, tag);
}
std::ofstream ofs(output, std::ios::out);