MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / delete_task

Method delete_task

source/MaaPiCli/CLI/interactor.cpp:1536–1559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534}
1535
1536void 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
1561void Interactor::move_task()
1562{

Callers

nothing calls this directly

Calls 3

input_multiFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected