初步完成贸易站换班的适配

This commit is contained in:
MistEO
2021-09-08 22:26:26 +08:00
parent 831071a326
commit eaebcdca5f
4 changed files with 99 additions and 4 deletions

View File

@@ -216,8 +216,23 @@ bool Assistance::start_debug_task()
std::unique_lock<std::mutex> lock(m_mutex);
//{
// append_match_task("Debug", {"UavAssist-MFG"});
//}
{
append_match_task("Debug", {"UavAssist-MFG"});
constexpr static const char* InfrastTaskCahin = "Infrast";
auto shift_task_ptr = std::make_shared<InfrastStationTask>(task_callback, (void*)this);
auto ret = get_opers_idtf_result();
if (!ret) {
DebugTraceInfo("Get opers info error");
//return false;
}
else {
shift_task_ptr->set_all_opers_info(std::move(ret.value()));
}
shift_task_ptr->set_task_chain(InfrastTaskCahin);
m_tasks_deque.emplace_back(shift_task_ptr);
}
m_thread_idle = false;

View File

@@ -57,8 +57,9 @@ bool asst::InfrastStationTask::run()
image = get_format_image();
}
// 如果当前界面没有添加干员的按钮,那就不换班
auto&& [algorithm, score, add_rect] = m_identify_ptr->find_image(image, "AddOperator");
if (score < Configer::TemplThresholdDefault) {
auto&& [algorithm1, score1, add_rect1] = m_identify_ptr->find_image(image, "AddOperator");
auto&& [algorithm2, score2, add_rect2] = m_identify_ptr->find_image(image, "AddOperator-Trade");
if (score1 < Configer::TemplThresholdDefault && score2 < Configer::TemplThresholdDefault) {
continue;
}
@@ -71,6 +72,7 @@ bool asst::InfrastStationTask::run()
}
}
//点击添加干员的那个按钮
Rect add_rect = score1 >= score2 ? std::move(add_rect1) : std::move(add_rect2);
m_control_ptr->click(add_rect);
sleep(2000);

View File

@@ -59,12 +59,90 @@
"endFlag": [ "月见夜", "炎熔" ],
"endFlag_Doc": "识别到这里面的名字,就不继续往后识别了,一般用列表里的最后一个人名"
},
{
"facility": "PureGold",
"Doc": "制造站-赤金",
"combs": [
{
"opers": [
{
"name": "砾",
"elite": 2
},
{
"name": "夜烟",
"elite": 0
},
{
"name": "斑点",
"elite": 1
}
],
"efficiency": 95
}
],
"endFlag": [ "月见夜", "炎熔" ],
"endFlag_Doc": "识别到这里面的名字,就不继续往后识别了,一般用列表里的最后一个人名"
},
{
"facility": "TradeMoney",
"Doc": "贸易站-龙门币",
"combs": [
{
"opers": [
{
"name": "巫恋",
"elite": 2
},
{
"name": "龙舌兰",
"elite": 2
},
{
"name": "卡夫卡",
"elite": 2
}
],
"efficiency": 150,
"Doc": "这三个有效率加成不知道怎么算的反正很高先按150写"
},
{
"opers": [
{
"name": "巫恋",
"elite": 2
},
{
"name": "龙舌兰",
"elite": 2
},
{
"name": "柏喙",
"elite": 2
}
],
"efficiency": 150,
"Doc": "这三个有效率加成不知道怎么算的反正很高先按150写"
},
{
"opers": [
{
"name": "能天使",
"elite": 2
},
{
"name": "拉普兰德",
"elite": 2
},
{
"name": "德克萨斯",
"elite": 2
}
],
"efficiency": 100
}
],
"endFlag": [ ],
"endFlag": [ "桃金娘", "暗锁" ],
"endFlag_Doc": "识别到这里面的名字,就不继续往后识别了,一般用列表里的最后一个人名"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB