refactor: 重构 Resource 类

fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/1541
This commit is contained in:
MistEO
2022-09-04 00:27:54 +08:00
parent f85e0db429
commit 7c8bf92eb4
72 changed files with 376 additions and 548 deletions

View File

@@ -1,6 +1,7 @@
#include "AutoRecruitTask.h"
#include "Controller.h"
#include "GeneralConfiger.h"
#include "Logger.hpp"
#include "MultiMatchImageAnalyzer.h"
#include "OcrImageAnalyzer.h"
@@ -8,7 +9,6 @@
#include "RecruitConfiger.h"
#include "RecruitImageAnalyzer.h"
#include "ReportDataTask.h"
#include "Resource.h"
#include "AsstRanges.hpp"
#include <algorithm>
@@ -18,7 +18,7 @@ namespace asst::recruit_calc
{
// all combinations and their operator list, excluding empty set and 6-star operators while there is no senior tag
auto get_all_combs(const std::vector<std::string>& tags,
const std::vector<RecruitOperInfo>& all_ops = Resrc.recruit().get_all_opers())
const std::vector<RecruitOperInfo>& all_ops = RecruitConfiger::get_instance().get_all_opers())
{
std::vector<RecruitCombs> rcs_with_single_tag;
@@ -273,7 +273,7 @@ bool asst::AutoRecruitTask::recruit_one(const Rect& button)
{
LogTraceFunction;
int delay = Resrc.cfg().get_options().task_delay;
int delay = GeneralConfiger::get_instance().get_options().task_delay;
m_ctrler->click(button);
sleep(delay);