mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
refactor.将肉鸽编队及战斗改为任务插件形式
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
#include "RoguelikeFormationTask.h"
|
||||
#include "RoguelikeFormationTaskPlugin.h"
|
||||
|
||||
#include "RoguelikeFormationImageAnalyzer.h"
|
||||
#include "Controller.h"
|
||||
#include "TaskData.h"
|
||||
#include "ProcessTask.h"
|
||||
|
||||
bool asst::RoguelikeFormationTask::_run()
|
||||
bool asst::RoguelikeFormationTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
{
|
||||
if (msg != AsstMsg::SubTaskCompleted
|
||||
|| details.get("subtask", std::string()) != "ProcessTask") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (details.at("details").at("task").as_string() == "Roguelike1QuickFormation") {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool asst::RoguelikeFormationTaskPlugin::_run()
|
||||
{
|
||||
RoguelikeFormationImageAnalyzer formation_analyzer(Ctrler.get_image());
|
||||
if (!formation_analyzer.analyze()) {
|
||||
@@ -19,11 +34,5 @@ bool asst::RoguelikeFormationTask::_run()
|
||||
Ctrler.click(oper.rect);
|
||||
}
|
||||
|
||||
return click_confirm();
|
||||
}
|
||||
|
||||
bool asst::RoguelikeFormationTask::click_confirm()
|
||||
{
|
||||
ProcessTask task(*this, { "Roguelike1FormationConfirm" });
|
||||
return task.run();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user