mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
perf: 优化下抄作业的小逻辑
This commit is contained in:
@@ -133,7 +133,7 @@ bool asst::BattleProcessTask::to_group()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asst::BattleProcessTask::do_action(const battle::copilot::Action& action, size_t action_index)
|
||||
bool asst::BattleProcessTask::do_action(const battle::copilot::Action& action, size_t index)
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
@@ -195,7 +195,7 @@ bool asst::BattleProcessTask::do_action(const battle::copilot::Action& action, s
|
||||
ret = wait_until_end();
|
||||
break;
|
||||
default:
|
||||
ret = do_derived_action(action_index);
|
||||
ret = do_derived_action(action, index);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,16 @@ namespace asst
|
||||
virtual AbstractTask& this_task() override { return *this; }
|
||||
virtual void clear() override;
|
||||
|
||||
virtual bool do_derived_action([[maybe_unused]] size_t action_index) { return false; }
|
||||
virtual bool do_derived_action([[maybe_unused]] const battle::copilot::Action& action,
|
||||
[[maybe_unused]] size_t index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual battle::copilot::CombatData& get_combat_data() { return m_combat_data; }
|
||||
virtual bool need_to_wait_until_end() const { return false; }
|
||||
|
||||
bool to_group();
|
||||
bool do_action(const battle::copilot::Action& action, size_t action_index);
|
||||
bool do_action(const battle::copilot::Action& action, size_t index);
|
||||
|
||||
const std::string& get_name_from_group(const std::string& action_name);
|
||||
void notify_action(const battle::copilot::Action& action);
|
||||
|
||||
@@ -37,11 +37,11 @@ bool asst::SSSBattleProcessTask::set_stage_name(const std::string& stage_name)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool asst::SSSBattleProcessTask::do_derived_action(size_t action_index)
|
||||
bool asst::SSSBattleProcessTask::do_derived_action(const battle::copilot::Action& action, size_t index)
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
const auto& action = get_combat_data().actions.at(action_index);
|
||||
std::ignore = index;
|
||||
|
||||
switch (action.type) {
|
||||
case battle::copilot::ActionType::DrawCard:
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace asst
|
||||
virtual bool set_stage_name(const std::string& stage_name) override;
|
||||
|
||||
protected:
|
||||
virtual bool do_derived_action(size_t action_index) override;
|
||||
virtual bool do_derived_action(const battle::copilot::Action& action, size_t index) override;
|
||||
virtual bool do_strategic_action(const cv::Mat& reusable = cv::Mat()) override;
|
||||
virtual battle::copilot::CombatData& get_combat_data() override { return m_sss_combat_data; }
|
||||
virtual const std::string oper_name_ocr_task_name() const noexcept override { return "SSSBattleOperName"; }
|
||||
|
||||
Reference in New Issue
Block a user