| 1534 | } |
| 1535 | |
| 1536 | void Interactor::delete_task() |
| 1537 | { |
| 1538 | using namespace MAA_PROJECT_INTERFACE_NS; |
| 1539 | |
| 1540 | auto& all_config_tasks = config_.configuration().task; |
| 1541 | if (all_config_tasks.empty()) { |
| 1542 | LogError << "Task is empty"; |
| 1543 | return; |
| 1544 | } |
| 1545 | |
| 1546 | std::cout << "### Delete task ###\n\n"; |
| 1547 | |
| 1548 | print_config_tasks(); |
| 1549 | |
| 1550 | auto input_indexes = input_multi(all_config_tasks.size()); |
| 1551 | |
| 1552 | std::unordered_set<int> indexes(input_indexes.begin(), input_indexes.end()); |
| 1553 | std::vector<int> sorted_indexes(indexes.begin(), indexes.end()); |
| 1554 | std::sort(sorted_indexes.begin(), sorted_indexes.end(), std::greater<int>()); |
| 1555 | |
| 1556 | for (int index : sorted_indexes) { |
| 1557 | all_config_tasks.erase(all_config_tasks.begin() + index - 1); |
| 1558 | } |
| 1559 | } |
| 1560 | |
| 1561 | void Interactor::move_task() |
| 1562 | { |
nothing calls this directly
no test coverage detected