完成进入最上方宿舍的功能,重构宿舍部分逻辑

This commit is contained in:
MistEO
2021-09-05 01:40:40 +08:00
parent 89a7ff907e
commit e9f52f9bed
30 changed files with 290 additions and 180 deletions

View File

@@ -41,8 +41,7 @@ bool asst::InfrastStationTask::run()
facility_number_rect.emplace_back(Rect()); // 假装给01 push一个后面循环好写=。=
for (const std::string& key : facility_number_key) {
Rect temp_rect;
auto&& [algorithm, value] = m_identify_ptr->find_image(image, key, &temp_rect);
auto&& [algorithm, value, temp_rect] = m_identify_ptr->find_image(image, key);
if (value >= Configer::TemplThresholdDefault) {
facility_number_rect.emplace_back(temp_rect);
}
@@ -58,15 +57,14 @@ bool asst::InfrastStationTask::run()
image = get_format_image();
}
// 如果当前界面没有添加干员的按钮,那就不换班
Rect add_rect;
auto&& [algorithm, value] = m_identify_ptr->find_image(image, "AddOperator", &add_rect);
auto&& [algorithm, value, add_rect] = m_identify_ptr->find_image(image, "AddOperator");
if (value < Configer::TemplThresholdDefault) {
continue;
}
// 识别当前正在造什么
for (const auto& [key, useless_value] : InfrastConfiger::get_instance().m_infrast_combs) {
auto&& [algorithm, value] = m_identify_ptr->find_image(image, key, nullptr);
auto&& [algorithm, value, useless_rect] = m_identify_ptr->find_image(image, key);
if (value >= Configer::TemplThresholdDefault) {
m_facility = key;
break;