From 4ebae9ea46ec301b8a99b59741dfa1e5116da33b Mon Sep 17 00:00:00 2001 From: lhhxxxxx <91231470+lhhxxxxx@users.noreply.github.com> Date: Thu, 13 Apr 2023 21:17:47 +0800 Subject: [PATCH] =?UTF-8?q?doc.=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Utils/Algorithm.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/MaaCore/Utils/Algorithm.hpp b/src/MaaCore/Utils/Algorithm.hpp index cad8a08fc0..a395350134 100644 --- a/src/MaaCore/Utils/Algorithm.hpp +++ b/src/MaaCore/Utils/Algorithm.hpp @@ -7,6 +7,24 @@ namespace asst::algorithm { + /** + * @brief 根据传入的分组规则及干员列表, 求解一个可行的分配方案 + * @param group_list 分组规则, key 为组名, value 为组内干员列表, 如:\n + * {\n + * "A": {"干员1", "干员2"},\n + * "B": {"干员2", "干员3"}\n + * } + * @param char_set 干员列表, 如:\n + * {\n + * "干员1",\n + * "干员2"\n + * } + * @return 可行的分配方案, key 为组名, value 为该组分配的干员, 若无可行方案则返回 std::nullopt, 如:\n + * {\n + * "A": "干员1",\n + * "B": "干员2"\n + * } + */ inline static std::optional> get_char_allocation_for_each_group( const std::unordered_map>& group_list, const std::unordered_set& char_set)