diff --git a/src/MeoAssistant/AbstractImageAnalyzer.h b/src/MeoAssistant/AbstractImageAnalyzer.h index bd3d222320..09a80142aa 100644 --- a/src/MeoAssistant/AbstractImageAnalyzer.h +++ b/src/MeoAssistant/AbstractImageAnalyzer.h @@ -3,9 +3,9 @@ #include "AsstTypes.h" #include "NoWarningCVMat.h" -//#ifndef ASST_DEBUG -//#define ASST_DEBUG -//#endif // ! ASST_DEBUG +// #ifndef ASST_DEBUG +// #define ASST_DEBUG +// #endif // ! ASST_DEBUG namespace asst { diff --git a/src/MeoAssistant/AbstractTask.h b/src/MeoAssistant/AbstractTask.h index f0b6b51a1e..74e28db78a 100644 --- a/src/MeoAssistant/AbstractTask.h +++ b/src/MeoAssistant/AbstractTask.h @@ -40,8 +40,8 @@ namespace asst virtual AbstractTask& set_task_id(int task_id) noexcept; template - std::shared_ptr register_plugin() requires - std::derived_from // Plugin must inherit AbstractTaskPlugin + std::shared_ptr register_plugin() + requires std::derived_from // Plugin must inherit AbstractTaskPlugin { auto plugin = std::make_shared(m_callback, m_callback_arg, m_task_chain); m_plugins.emplace(plugin); diff --git a/src/MeoAssistant/AsstTypes.h b/src/MeoAssistant/AsstTypes.h index d289dc99cd..90bc47c885 100644 --- a/src/MeoAssistant/AsstTypes.h +++ b/src/MeoAssistant/AsstTypes.h @@ -72,18 +72,12 @@ namespace asst { return { value.x * scalar, value.y * scalar }; } - static int dot(const Point& lhs, const Point& rhs) noexcept - { - return (lhs.x * rhs.x) + (lhs.y * rhs.y); - } + static int dot(const Point& lhs, const Point& rhs) noexcept { return (lhs.x * rhs.x) + (lhs.y * rhs.y); } static double distance(const Point& lhs, const Point& rhs) noexcept { return std::sqrt(std::pow(rhs.x - lhs.x, 2) + std::pow(rhs.y - lhs.y, 2)); } - double length() const noexcept - { - return std::sqrt(static_cast(dot(*this, *this))); - } + double length() const noexcept { return std::sqrt(static_cast(dot(*this, *this))); } }; struct Rect diff --git a/src/MeoAssistant/AsstUtils.hpp b/src/MeoAssistant/AsstUtils.hpp index b895d7b957..800b595336 100644 --- a/src/MeoAssistant/AsstUtils.hpp +++ b/src/MeoAssistant/AsstUtils.hpp @@ -56,9 +56,9 @@ namespace asst::utils } template - inline std::string string_replace_all_batch(const std::string& src, const map_t& replace_pairs) requires - std::derived_from && - std::derived_from + inline std::string string_replace_all_batch(const std::string& src, const map_t& replace_pairs) + requires std::derived_from && + std::derived_from { std::string str = src; for (const auto& [old_value, new_value] : replace_pairs) { diff --git a/src/MeoAssistant/DebugTask.cpp b/src/MeoAssistant/DebugTask.cpp index 37b4a50e56..077e6587b1 100644 --- a/src/MeoAssistant/DebugTask.cpp +++ b/src/MeoAssistant/DebugTask.cpp @@ -4,7 +4,7 @@ #include "NoWarningCV.h" -//#include "RoguelikeSkillSelectionTaskPlugin.h" +// #include "RoguelikeSkillSelectionTaskPlugin.h" #include "Logger.hpp" #include "StageDropsImageAnalyzer.h" diff --git a/src/MeoAssistant/InfrastDormTask.cpp b/src/MeoAssistant/InfrastDormTask.cpp index 7ef7cdf15c..7d6c328113 100644 --- a/src/MeoAssistant/InfrastDormTask.cpp +++ b/src/MeoAssistant/InfrastDormTask.cpp @@ -50,7 +50,7 @@ bool asst::InfrastDormTask::_run() click_confirm_button(); click_return_button(); - if (m_finished_stage == 3) { //不蹭信赖或所有干员满信赖 + if (m_finished_stage == 3) { // 不蹭信赖或所有干员满信赖 break; } } @@ -93,7 +93,7 @@ bool asst::InfrastDormTask::opers_choose() if (m_trust_enabled && m_finished_stage > 0 && oper.selected == false && oper.doing != infrast::Doing::Working && oper.doing != infrast::Doing::Resting) { - //获得干员信赖值 + // 获得干员信赖值 OcrWithPreprocessImageAnalyzer trust_analyzer(oper.name_img); if (!trust_analyzer.analyze()) { Log.trace("ERROR:!trust_analyzer.analyze():"); @@ -101,7 +101,7 @@ bool asst::InfrastDormTask::opers_choose() } std::string opertrust = trust_analyzer.get_result().front().text; - std::regex rule("[^0-9]"); //只保留数字 + std::regex rule("[^0-9]"); // 只保留数字 opertrust = std::regex_replace(opertrust, rule, ""); Log.trace("opertrust:", opertrust); @@ -113,13 +113,13 @@ bool asst::InfrastDormTask::opers_choose() else if (opertrust != "" && atoi(opertrust.c_str()) >= 200) { num_of_fulltrust++; } - if (num_of_fulltrust >= 6) { //所有干员都满信赖了 + if (num_of_fulltrust >= 6) { // 所有干员都满信赖了 m_finished_stage = 3; Log.trace("num_of_fulltrust:", num_of_fulltrust, ", just return"); return true; } - //获得干员所在设施 + // 获得干员所在设施 OcrWithPreprocessImageAnalyzer facility_analyzer(oper.facility_img); if (!facility_analyzer.analyze()) { Log.trace("ERROR:!facility_analyzer.analyze():"); @@ -127,13 +127,13 @@ bool asst::InfrastDormTask::opers_choose() } std::string facilityname = facility_analyzer.get_result().front().text; - std::regex rule2("[^BF0-9]"); //只保留B、F和数字 + std::regex rule2("[^BF0-9]"); // 只保留B、F和数字 facilityname = std::regex_replace(facilityname, rule2, ""); Log.trace("facilityname:<" + facilityname + ">"); - bool if_oper_not_stationed = facilityname.length() < 4; //只有形如1F01或B101才是设施标签 + bool if_oper_not_stationed = facilityname.length() < 4; // 只有形如1F01或B101才是设施标签 - //判断要不要把人放进宿舍if_opertrust_not_full && if_oper_not_stationed + // 判断要不要把人放进宿舍if_opertrust_not_full && if_oper_not_stationed if (if_opertrust_not_full && if_oper_not_stationed) { Log.trace("put oper in"); diff --git a/src/MeoAssistant/InfrastDormTask.h b/src/MeoAssistant/InfrastDormTask.h index 7668e58a39..aabfce4f5f 100644 --- a/src/MeoAssistant/InfrastDormTask.h +++ b/src/MeoAssistant/InfrastDormTask.h @@ -20,8 +20,8 @@ namespace asst bool opers_choose(); - bool m_notstationed_enabled = false; //设置是否启用未进驻筛选 - bool m_trust_enabled = true; //设置是否启用蹭信赖 + bool m_notstationed_enabled = false; // 设置是否启用未进驻筛选 + bool m_trust_enabled = true; // 设置是否启用蹭信赖 int m_cur_dorm_index = 0; int m_max_num_of_dorm = 4; diff --git a/src/MeoAssistant/RuntimeStatus.h b/src/MeoAssistant/RuntimeStatus.h index a53cb4bf2b..01079af9d6 100644 --- a/src/MeoAssistant/RuntimeStatus.h +++ b/src/MeoAssistant/RuntimeStatus.h @@ -1,6 +1,6 @@ #pragma once -//#include +// #include #include #include #include diff --git a/src/MeoAssistant/TaskData.h b/src/MeoAssistant/TaskData.h index a4075c47a2..bc37e9c0ea 100644 --- a/src/MeoAssistant/TaskData.h +++ b/src/MeoAssistant/TaskData.h @@ -27,8 +27,8 @@ namespace asst template requires std::derived_from && - (!std::same_as) // Parameter must be a TaskInfo and not same as TaskInfo - std::shared_ptr get(const std::string& name) + (!std::same_as) // Parameter must be a TaskInfo and not same as TaskInfo + std::shared_ptr get(const std::string& name) { auto it = m_all_tasks_info.find(name); if (it == m_all_tasks_info.cend()) { @@ -40,7 +40,7 @@ namespace asst template requires std::same_as // Parameter must be a TaskInfo - std::shared_ptr get(const std::string& name) + std::shared_ptr get(const std::string& name) { auto it = m_all_tasks_info.find(name); if (it == m_all_tasks_info.cend()) {