mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
revert. delete [[nodiscard]]
This commit is contained in:
@@ -14,7 +14,7 @@ namespace asst
|
||||
virtual ~AbstractResource() = default;
|
||||
|
||||
virtual bool load(const std::string& filename) = 0;
|
||||
[[nodiscard]] virtual const std::string& get_last_error() const noexcept
|
||||
virtual const std::string& get_last_error() const noexcept
|
||||
{
|
||||
return m_last_error;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace asst
|
||||
Point& operator=(Point&&) noexcept = default;
|
||||
Point operator-() const noexcept { return {-x, -y}; }
|
||||
bool operator==(const Point& rhs) const noexcept { return x == rhs.x && y == rhs.y; }
|
||||
[[nodiscard]] std::string to_string() const
|
||||
std::string to_string() const
|
||||
{
|
||||
return "[ " + std::to_string(x) + ", " + std::to_string(y) + " ]";
|
||||
}
|
||||
@@ -62,7 +62,7 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
{
|
||||
return std::sqrt(double(std::pow(rhs.x - lhs.x, 2) + std::pow(rhs.y - lhs.y, 2)));
|
||||
}
|
||||
[[nodiscard]] double length() const noexcept { return std::sqrt(double(dot(*this, *this))); }
|
||||
double length() const noexcept { return std::sqrt(double(dot(*this, *this))); }
|
||||
};
|
||||
|
||||
struct Rect
|
||||
@@ -77,11 +77,11 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
{
|
||||
return { x, y, static_cast<int>(width * rhs), static_cast<int>(height * rhs) };
|
||||
}
|
||||
[[nodiscard]] int area() const noexcept
|
||||
int area() const noexcept
|
||||
{
|
||||
return width * height;
|
||||
}
|
||||
[[nodiscard]] Rect center_zoom(double scale, int max_width = INT_MAX, int max_height = INT_MAX) const
|
||||
Rect center_zoom(double scale, int max_width = INT_MAX, int max_height = INT_MAX) const
|
||||
{
|
||||
int half_width_scale = static_cast<int>(width * (1 - scale) / 2);
|
||||
int half_hight_scale = static_cast<int>(height * (1 - scale) / 2);
|
||||
@@ -103,24 +103,24 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
}
|
||||
Rect& operator=(const Rect&) noexcept = default;
|
||||
Rect& operator=(Rect&&) noexcept = default;
|
||||
[[nodiscard]] bool empty() const noexcept { return width == 0 || height == 0; }
|
||||
bool empty() const noexcept { return width == 0 || height == 0; }
|
||||
bool operator==(const Rect& rhs) const noexcept
|
||||
{
|
||||
return x == rhs.x && y == rhs.y && width == rhs.width && height == rhs.height;
|
||||
}
|
||||
[[nodiscard]] bool include(const Rect& rhs) const noexcept
|
||||
bool include(const Rect& rhs) const noexcept
|
||||
{
|
||||
return x <= rhs.x && y <= rhs.y && (x + width) >= (rhs.x + rhs.width) && (y + height) >= (rhs.y + rhs.height);
|
||||
}
|
||||
[[nodiscard]] bool include(const Point& rhs) const noexcept
|
||||
bool include(const Point& rhs) const noexcept
|
||||
{
|
||||
return x <= rhs.x && y <= rhs.y && (x + width) >= rhs.x && (y + height) >= rhs.y;
|
||||
}
|
||||
[[nodiscard]] std::string to_string() const
|
||||
std::string to_string() const
|
||||
{
|
||||
return "[ " + std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(width) + ", " + std::to_string(height) + " ]";
|
||||
}
|
||||
[[nodiscard]] Rect move(Rect move) const
|
||||
Rect move(Rect move) const
|
||||
{
|
||||
return { x + move.x, y + move.y, move.width, move.height };
|
||||
}
|
||||
@@ -139,7 +139,7 @@ friend Point& operator Op##= (Point& val, const Point& opd) noexcept { val.x Op#
|
||||
|
||||
explicit operator std::string() const noexcept { return text; }
|
||||
explicit operator Rect() const noexcept { return rect; }
|
||||
[[nodiscard]] std::string to_string() const
|
||||
std::string to_string() const
|
||||
{
|
||||
return text + " : " + rect.to_string() + ", score: " + std::to_string(score);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace asst
|
||||
public:
|
||||
virtual ~BattleDataConfiger() override = default;
|
||||
|
||||
[[nodiscard]] BattleRole get_role(const std::string& name) const
|
||||
BattleRole get_role(const std::string& name) const
|
||||
{
|
||||
auto iter = m_chars.find(name);
|
||||
if (iter == m_chars.cend()) {
|
||||
@@ -24,7 +24,7 @@ namespace asst
|
||||
|
||||
static inline const BattleAttackRange& EmptyRange{ {0, 0} };
|
||||
|
||||
[[nodiscard]] const BattleAttackRange& get_range(const std::string& name, size_t index) const
|
||||
const BattleAttackRange& get_range(const std::string& name, size_t index) const
|
||||
{
|
||||
auto char_iter = m_chars.find(name);
|
||||
if (char_iter == m_chars.cend()) {
|
||||
|
||||
@@ -29,14 +29,14 @@ namespace asst
|
||||
void set_pre_total_kills(int pre_total_kills);
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] virtual const std::vector<BattleRealTimeOper>& get_opers() const noexcept;
|
||||
[[nodiscard]] virtual const std::vector<Rect>& get_homes() const noexcept;
|
||||
virtual const std::vector<BattleRealTimeOper>& get_opers() const noexcept;
|
||||
virtual const std::vector<Rect>& get_homes() const noexcept;
|
||||
|
||||
[[nodiscard]] const std::vector<Rect>& get_ready_skills() const noexcept;
|
||||
[[nodiscard]] int get_hp() const noexcept;
|
||||
[[nodiscard]] int get_kills() const noexcept;
|
||||
[[nodiscard]] int get_total_kills() const noexcept;
|
||||
[[nodiscard]] int get_cost() const noexcept;
|
||||
const std::vector<Rect>& get_ready_skills() const noexcept;
|
||||
int get_hp() const noexcept;
|
||||
int get_kills() const noexcept;
|
||||
int get_total_kills() const noexcept;
|
||||
int get_cost() const noexcept;
|
||||
|
||||
void clear() noexcept;
|
||||
void sort_opers_by_cost(); // 高费在前,费用降序
|
||||
|
||||
@@ -9,12 +9,12 @@ namespace asst
|
||||
public:
|
||||
virtual ~CopilotConfiger() override = default;
|
||||
|
||||
[[nodiscard]] bool contains_actions(const std::string& stage_name) const noexcept
|
||||
bool contains_actions(const std::string& stage_name) const noexcept
|
||||
{
|
||||
return m_battle_actions.find(stage_name) != m_battle_actions.cend();
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_actions(const std::string& stage_name) const noexcept
|
||||
auto get_actions(const std::string& stage_name) const noexcept
|
||||
{
|
||||
return m_battle_actions.at(stage_name);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace asst
|
||||
void set_black_list(std::vector<std::string> black_list);
|
||||
void set_white_list(std::vector<std::string> white_list);
|
||||
|
||||
[[nodiscard]] const std::vector<Rect>& get_result() const noexcept
|
||||
const std::vector<Rect>& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace asst
|
||||
virtual bool analyze() override;
|
||||
|
||||
void set_match_begin_pos(size_t pos) noexcept;
|
||||
[[nodiscard]] size_t get_match_begin_pos() const noexcept;
|
||||
[[nodiscard]] const auto& get_result() const noexcept
|
||||
size_t get_match_begin_pos() const noexcept;
|
||||
const auto& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -62,11 +62,11 @@ namespace asst
|
||||
public:
|
||||
virtual ~GeneralConfiger() override = default;
|
||||
|
||||
[[nodiscard]] const std::string& get_version() const noexcept
|
||||
const std::string& get_version() const noexcept
|
||||
{
|
||||
return m_version;
|
||||
}
|
||||
[[nodiscard]] const Options& get_options() const noexcept
|
||||
const Options& get_options() const noexcept
|
||||
{
|
||||
return m_options;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace asst
|
||||
{
|
||||
return m_options;
|
||||
}
|
||||
[[nodiscard]] std::optional<AdbCfg> get_adb_cfg(const std::string& name) const
|
||||
std::optional<AdbCfg> get_adb_cfg(const std::string& name) const
|
||||
{
|
||||
if (auto iter = m_adb_cfg.find(name);
|
||||
iter != m_adb_cfg.cend()) {
|
||||
@@ -85,7 +85,7 @@ namespace asst
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] std::optional<std::string> get_intent_name(const std::string& client_type) const
|
||||
std::optional<std::string> get_intent_name(const std::string& client_type) const
|
||||
{
|
||||
if (auto iter = m_intent_name.find(client_type);
|
||||
iter != m_intent_name.cend()) {
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace asst
|
||||
void set_need_split(bool need_split) noexcept;
|
||||
void set_need_bound(bool need_bound) noexcept;
|
||||
|
||||
[[nodiscard]] const std::vector<std::string>& get_min_dist_name() const noexcept;
|
||||
[[nodiscard]] const std::vector<std::string>& get_hash() const noexcept;
|
||||
const std::vector<std::string>& get_min_dist_name() const noexcept;
|
||||
const std::vector<std::string>& get_hash() const noexcept;
|
||||
|
||||
static std::string shash(const cv::Mat& img);
|
||||
static int hamming(std::string hash1, std::string hash2);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] const std::vector<std::pair<Rect, std::string>>& get_result() const noexcept
|
||||
const std::vector<std::pair<Rect, std::string>>& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace asst
|
||||
m_to_be_analyzed = std::move(to_be_analyzed);
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::unordered_map<std::string, Rect>& get_vacancy() const noexcept
|
||||
const std::unordered_map<std::string, Rect>& get_vacancy() const noexcept
|
||||
{
|
||||
return m_clue_vacancy;
|
||||
}
|
||||
|
||||
@@ -13,23 +13,23 @@ namespace asst
|
||||
public:
|
||||
virtual ~InfrastConfiger() override = default;
|
||||
|
||||
[[nodiscard]] auto get_templ_required() const noexcept -> const std::unordered_set<std::string>&
|
||||
auto get_templ_required() const noexcept -> const std::unordered_set<std::string>&
|
||||
{
|
||||
return m_templ_required;
|
||||
}
|
||||
[[nodiscard]] auto get_skills(const std::string& facility_name) const -> const std::unordered_map<std::string, infrast::Skill>&
|
||||
auto get_skills(const std::string& facility_name) const -> const std::unordered_map<std::string, infrast::Skill>&
|
||||
{
|
||||
return m_skills.at(facility_name);
|
||||
}
|
||||
[[nodiscard]] auto get_skills_group(const std::string& facility) const -> const std::vector<infrast::SkillsGroup>&
|
||||
auto get_skills_group(const std::string& facility) const -> const std::vector<infrast::SkillsGroup>&
|
||||
{
|
||||
return m_skills_groups.at(facility);
|
||||
}
|
||||
[[nodiscard]] auto get_facility_info(const std::string& facility) const -> const infrast::Facility&
|
||||
auto get_facility_info(const std::string& facility) const -> const infrast::Facility&
|
||||
{
|
||||
return m_facilities_info.at(facility);
|
||||
}
|
||||
[[nodiscard]] auto get_facility_info() const noexcept -> const std::unordered_map<std::string, infrast::Facility>&
|
||||
auto get_facility_info() const noexcept -> const std::unordered_map<std::string, infrast::Facility>&
|
||||
{
|
||||
return m_facilities_info;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace asst
|
||||
m_to_be_analyzed = std::move(facilities);
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t get_quantity(const std::string& name) const
|
||||
size_t get_quantity(const std::string& name) const
|
||||
{
|
||||
if (auto iter = m_result.find(name);
|
||||
iter == m_result.cend()) {
|
||||
@@ -27,7 +27,7 @@ namespace asst
|
||||
return iter->second.size();
|
||||
}
|
||||
}
|
||||
[[nodiscard]] Rect get_rect(const std::string& name, int index) const
|
||||
Rect get_rect(const std::string& name, int index) const
|
||||
{
|
||||
if (auto iter = m_result.find(name);
|
||||
iter == m_result.cend()) {
|
||||
@@ -42,7 +42,7 @@ namespace asst
|
||||
}
|
||||
}
|
||||
}
|
||||
[[nodiscard]] const std::unordered_map<std::string, std::vector<MatchRect>>& get_result() const noexcept
|
||||
const std::unordered_map<std::string, std::vector<MatchRect>>& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace asst
|
||||
void sort_by_loc();
|
||||
void sort_by_mood();
|
||||
|
||||
[[nodiscard]] auto get_result() const noexcept -> const std::vector<infrast::Oper>&
|
||||
auto get_result() const noexcept -> const std::vector<infrast::Oper>&
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
[[nodiscard]] int get_num_of_opers_with_skills() const noexcept
|
||||
int get_num_of_opers_with_skills() const noexcept
|
||||
{
|
||||
return m_num_of_opers_with_skills;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] auto get_result() const noexcept -> const std::vector<infrast::Smiley>&
|
||||
auto get_result() const noexcept -> const std::vector<infrast::Smiley>&
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace asst
|
||||
public:
|
||||
virtual ~ItemConfiger() override = default;
|
||||
|
||||
[[nodiscard]] const std::string& get_item_name(const std::string& id) const noexcept
|
||||
const std::string& get_item_name(const std::string& id) const noexcept
|
||||
{
|
||||
if (id.empty()) {
|
||||
static const std::string unknown = "Unknown";
|
||||
@@ -27,11 +27,11 @@ namespace asst
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
[[nodiscard]] const auto& get_all_item_id() const noexcept
|
||||
const auto& get_all_item_id() const noexcept
|
||||
{
|
||||
return m_all_item_id;
|
||||
}
|
||||
[[nodiscard]] const auto& get_ordered_material_item_id() const noexcept
|
||||
const auto& get_ordered_material_item_id() const noexcept
|
||||
{
|
||||
return m_ordered_material_item_id;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace asst
|
||||
void set_region_of_appeared(Rect region) noexcept;
|
||||
void set_mask_with_close(int with_close) noexcept;
|
||||
|
||||
[[nodiscard]] const MatchRect& get_result() const noexcept;
|
||||
const MatchRect& get_result() const noexcept;
|
||||
|
||||
protected:
|
||||
virtual bool match_templ(const cv::Mat templ);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace asst
|
||||
void set_task_info(const std::shared_ptr<TaskInfo>& task_ptr);
|
||||
void set_task_info(const std::string& task_name);
|
||||
|
||||
[[nodiscard]] const std::vector<MatchRect>& get_result() const noexcept;
|
||||
const std::vector<MatchRect>& get_result() const noexcept;
|
||||
|
||||
protected:
|
||||
virtual bool multi_match_templ(const cv::Mat templ);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace asst
|
||||
virtual void set_region_of_appeared(Rect region) noexcept;
|
||||
|
||||
void set_pred(const TextRectProc& pred);
|
||||
[[nodiscard]] virtual const std::vector<TextRect>& get_result() const noexcept;
|
||||
virtual const std::vector<TextRect>& get_result() const noexcept;
|
||||
virtual std::vector<TextRect>& get_result() noexcept;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] virtual const std::vector<TextRect>& get_result() const noexcept override;
|
||||
virtual const std::vector<TextRect>& get_result() const noexcept override;
|
||||
virtual std::vector<TextRect>& get_result() noexcept override;
|
||||
|
||||
void set_task_info(const std::string& templ_task_name, const std::string& ocr_task_name); // FIXME: hiding virtual function
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace asst
|
||||
void set_tasks(std::vector<std::string> tasks_name);
|
||||
void set_status(std::shared_ptr<RuntimeStatus> status) noexcept;
|
||||
|
||||
[[nodiscard]] std::shared_ptr<TaskInfo> get_result() const noexcept
|
||||
std::shared_ptr<TaskInfo> get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
[[nodiscard]] const Rect& get_rect() const noexcept
|
||||
const Rect& get_rect() const noexcept
|
||||
{
|
||||
return m_result_rect;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace asst
|
||||
bool hidden = false;
|
||||
std::string name_en;
|
||||
|
||||
[[nodiscard]] bool has_tag(const std::string &tag) const {
|
||||
bool has_tag(const std::string &tag) const {
|
||||
return tags.find(tag) != tags.cend();
|
||||
}
|
||||
|
||||
@@ -87,11 +87,11 @@ namespace asst
|
||||
virtual ~RecruitConfiger() override = default;
|
||||
constexpr static int CorrectNumberOfTags = 5;
|
||||
|
||||
[[nodiscard]] const std::unordered_set<std::string>& get_all_tags() const noexcept
|
||||
const std::unordered_set<std::string>& get_all_tags() const noexcept
|
||||
{
|
||||
return m_all_tags;
|
||||
}
|
||||
[[nodiscard]] const std::vector<RecruitOperInfo>& get_all_opers() const noexcept
|
||||
const std::vector<RecruitOperInfo>& get_all_opers() const noexcept
|
||||
{
|
||||
return m_all_opers;
|
||||
}
|
||||
|
||||
@@ -14,19 +14,19 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] const std::vector<TextRect>& get_tags_result() const noexcept
|
||||
const std::vector<TextRect>& get_tags_result() const noexcept
|
||||
{
|
||||
return m_tags_result;
|
||||
}
|
||||
[[nodiscard]] const std::vector<Rect>& get_set_time_rect() const noexcept
|
||||
const std::vector<Rect>& get_set_time_rect() const noexcept
|
||||
{
|
||||
return m_set_time_rect;
|
||||
}
|
||||
[[nodiscard]] Rect get_confirm_rect() const noexcept
|
||||
Rect get_confirm_rect() const noexcept
|
||||
{
|
||||
return m_confirm_rect;
|
||||
}
|
||||
[[nodiscard]] Rect get_refresh_rect() const noexcept
|
||||
Rect get_refresh_rect() const noexcept
|
||||
{
|
||||
return m_refresh_rect;
|
||||
}
|
||||
|
||||
@@ -88,55 +88,55 @@ namespace asst
|
||||
return m_roguelike_shopping_cfg_unique_ins;
|
||||
}
|
||||
|
||||
[[nodiscard]] const TemplResource& templ() const noexcept
|
||||
const TemplResource& templ() const noexcept
|
||||
{
|
||||
return m_templ_resource_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const GeneralConfiger& cfg() const noexcept
|
||||
const GeneralConfiger& cfg() const noexcept
|
||||
{
|
||||
return m_general_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const RecruitConfiger& recruit() const noexcept
|
||||
const RecruitConfiger& recruit() const noexcept
|
||||
{
|
||||
return m_recruit_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const RoguelikeRecruitConfiger& roguelike_recruit() const noexcept
|
||||
const RoguelikeRecruitConfiger& roguelike_recruit() const noexcept
|
||||
{
|
||||
return m_roguelike_recruit_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const ItemConfiger& item() const noexcept
|
||||
const ItemConfiger& item() const noexcept
|
||||
{
|
||||
return m_item_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const InfrastConfiger& infrast() const noexcept
|
||||
const InfrastConfiger& infrast() const noexcept
|
||||
{
|
||||
return m_infrast_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const CopilotConfiger& copilot() const noexcept
|
||||
const CopilotConfiger& copilot() const noexcept
|
||||
{
|
||||
return m_copilot_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const RoguelikeCopilotConfiger& roguelike() const noexcept
|
||||
const RoguelikeCopilotConfiger& roguelike() const noexcept
|
||||
{
|
||||
return m_roguelike_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const OcrPack& ocr() const noexcept
|
||||
const OcrPack& ocr() const noexcept
|
||||
{
|
||||
return m_ocr_pack_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const TilePack& tile() const noexcept
|
||||
const TilePack& tile() const noexcept
|
||||
{
|
||||
return m_tile_pack_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const StageDropsConfiger& drops() const noexcept
|
||||
const StageDropsConfiger& drops() const noexcept
|
||||
{
|
||||
return m_stage_drops_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const BattleDataConfiger& battle_data() const noexcept
|
||||
const BattleDataConfiger& battle_data() const noexcept
|
||||
{
|
||||
return m_battle_data_cfg_unique_ins;
|
||||
}
|
||||
[[nodiscard]] const RoguelikeShoppingConfiger& roguelike_shopping() const noexcept
|
||||
const RoguelikeShoppingConfiger& roguelike_shopping() const noexcept
|
||||
{
|
||||
return m_roguelike_shopping_cfg_unique_ins;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace asst
|
||||
public:
|
||||
virtual ~RoguelikeCopilotConfiger() override = default;
|
||||
|
||||
[[nodiscard]] std::optional<RoguelikeBattleData> get_stage_data(const std::string& stage_name) const;
|
||||
std::optional<RoguelikeBattleData> get_stage_data(const std::string& stage_name) const;
|
||||
|
||||
protected:
|
||||
virtual bool parse(const json::value& json) override;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] const std::vector<FormationOper>& get_result() const noexcept;
|
||||
const std::vector<FormationOper>& get_result() const noexcept;
|
||||
protected:
|
||||
// 该分析器不支持外部设置ROI
|
||||
virtual void set_roi(const Rect& roi) noexcept override
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace asst
|
||||
public:
|
||||
virtual ~RoguelikeRecruitConfiger() override = default;
|
||||
|
||||
[[nodiscard]] const RoguelikeOperInfo& get_oper_info(const std::string& name) const noexcept;
|
||||
[[nodiscard]] const auto& get_oper_order() const noexcept { return m_ordered_all_opers_name; }
|
||||
const RoguelikeOperInfo& get_oper_info(const std::string& name) const noexcept;
|
||||
const auto& get_oper_order() const noexcept { return m_ordered_all_opers_name; }
|
||||
|
||||
protected:
|
||||
virtual bool parse(const json::value& json) override;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace asst
|
||||
|
||||
bool analyze() override;
|
||||
|
||||
[[nodiscard]] const auto& get_result() const noexcept
|
||||
const auto& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace asst
|
||||
public:
|
||||
virtual ~RoguelikeShoppingConfiger() override = default;
|
||||
|
||||
[[nodiscard]] const auto& get_goods() const noexcept
|
||||
const auto& get_goods() const noexcept
|
||||
{
|
||||
return m_goods;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] const auto& get_result() const noexcept
|
||||
const auto& get_result() const noexcept
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@ namespace asst
|
||||
RuntimeStatus(RuntimeStatus&& rhs) noexcept = delete;
|
||||
~RuntimeStatus() = default;
|
||||
|
||||
[[nodiscard]] std::optional<int64_t> get_number(const std::string& key) const noexcept;
|
||||
std::optional<int64_t> get_number(const std::string& key) const noexcept;
|
||||
void set_number(std::string key, int64_t value);
|
||||
void clear_number() noexcept;
|
||||
|
||||
[[nodiscard]] std::optional<Rect> get_rect(const std::string& key) const noexcept;
|
||||
std::optional<Rect> get_rect(const std::string& key) const noexcept;
|
||||
void set_rect(std::string key, Rect rect);
|
||||
void clear_rect() noexcept;
|
||||
|
||||
[[nodiscard]] std::optional<std::string> get_str(const std::string& key) const noexcept;
|
||||
std::optional<std::string> get_str(const std::string& key) const noexcept;
|
||||
void set_str(std::string key, std::string value);
|
||||
void clear_str() noexcept;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace asst
|
||||
using AbstractConfiger::AbstractConfiger;
|
||||
virtual ~StageDropsConfiger() override = default;
|
||||
|
||||
[[nodiscard]] const auto& get_stage_info(const std::string& code, StageDifficulty difficulty) const
|
||||
const auto& get_stage_info(const std::string& code, StageDifficulty difficulty) const
|
||||
{
|
||||
StageKey key{ code, difficulty };
|
||||
if (auto find_iter = m_stage_info.find(key);
|
||||
@@ -74,11 +74,11 @@ namespace asst
|
||||
return empty_info;
|
||||
}
|
||||
}
|
||||
[[nodiscard]] const auto& get_all_stage_code() const
|
||||
const auto& get_all_stage_code() const
|
||||
{
|
||||
return m_all_stage_code;
|
||||
}
|
||||
[[nodiscard]] const auto& get_all_item_id() const
|
||||
const auto& get_all_item_id() const
|
||||
{
|
||||
return m_all_item_id;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace asst
|
||||
|
||||
virtual bool analyze() override;
|
||||
|
||||
[[nodiscard]] StageKey get_stage_key() const;
|
||||
[[nodiscard]] int get_stars() const noexcept;
|
||||
StageKey get_stage_key() const;
|
||||
int get_stars() const noexcept;
|
||||
|
||||
// <droptype, <item_id, quantity>>
|
||||
[[nodiscard]] const auto& get_drops() const noexcept
|
||||
const auto& get_drops() const noexcept
|
||||
{
|
||||
return m_drops;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace asst
|
||||
static TaskData unique_instance;
|
||||
return unique_instance;
|
||||
}
|
||||
[[nodiscard]] const std::unordered_set<std::string>& get_templ_required() const noexcept;
|
||||
const std::unordered_set<std::string>& get_templ_required() const noexcept;
|
||||
|
||||
template<typename TargetTaskInfoType = TaskInfo>
|
||||
std::shared_ptr<TargetTaskInfoType> get(const std::string& name)
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace asst
|
||||
void set_load_required(std::unordered_set<std::string> required) noexcept;
|
||||
virtual bool load(const std::string& dir) override;
|
||||
|
||||
[[nodiscard]] bool exist_templ(const std::string& key) const noexcept;
|
||||
[[nodiscard]] const cv::Mat get_templ(const std::string& key) const noexcept;
|
||||
bool exist_templ(const std::string& key) const noexcept;
|
||||
const cv::Mat get_templ(const std::string& key) const noexcept;
|
||||
|
||||
void emplace_templ(std::string key, cv::Mat templ);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace asst
|
||||
|
||||
virtual bool load(const std::string& dir) override;
|
||||
|
||||
[[nodiscard]] std::unordered_map<Point, TileInfo> calc(const std::string& stage_code, bool side) const;
|
||||
std::unordered_map<Point, TileInfo> calc(const std::string& stage_code, bool side) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Map::TileCalc> m_tile_calculator = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user