fix: fix output of auto recruit task when there is senior tag

This commit is contained in:
Horror Proton
2022-08-02 23:13:50 +08:00
parent aca00c85d4
commit b463cec24c

View File

@@ -29,12 +29,9 @@ namespace asst::recruit_calc
return result;
});
static constexpr std::string_view SeniorOper = "高级资深干员";
for (const auto& op : all_ops) {
for (auto& rc : rcs_with_single_tag) {
if (!op.has_tag(rc.tags.front())) continue;
if (op.level == 6 && rc.tags.front() != SeniorOper) continue;
rc.opers.push_back(op);
rc.min_level = (std::min)(rc.min_level, op.level);
rc.max_level = (std::max)(rc.max_level, op.level);
@@ -73,6 +70,22 @@ namespace asst::recruit_calc
}
}
static constexpr std::string_view SeniorOper = "高级资深干员";
for (auto comb_iter = result.begin(); comb_iter != result.end(); ++comb_iter) {
if (std::ranges::find(comb_iter->tags, SeniorOper) != comb_iter->tags.end()) continue;
// no senior tag, remove 6-star operators
// assuming sorted by level
auto iter = std::ranges::find_if(comb_iter->opers, [](const RecruitOperInfo& op) { return op.level >= 6; });
if (iter == comb_iter->opers.end()) continue;
comb_iter->opers.erase(iter, comb_iter->opers.end());
if (comb_iter->opers.empty()) {
comb_iter = result.erase(comb_iter);
continue;
}
comb_iter->update_attributes();
}
return result;
}
}