| 72 | static command_result orders_recheck_current_command(color_ostream & out); |
| 73 | |
| 74 | static command_result orders_command(color_ostream & out, std::vector<std::string> & parameters) |
| 75 | { |
| 76 | class color_ostream_resetter |
| 77 | { |
| 78 | color_ostream & out; |
| 79 | |
| 80 | public: |
| 81 | color_ostream_resetter(color_ostream & out) : out(out) {} |
| 82 | ~color_ostream_resetter() { out.reset_color(); } |
| 83 | } resetter(out); |
| 84 | |
| 85 | if (parameters.empty()) |
| 86 | { |
| 87 | return CR_WRONG_USAGE; |
| 88 | } |
| 89 | |
| 90 | if (parameters[0] == "list") |
| 91 | { |
| 92 | return orders_list_command(out); |
| 93 | } |
| 94 | |
| 95 | if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { |
| 96 | out.printerr("Cannot run {} without a loaded fort.\n", plugin_name); |
| 97 | return CR_FAILURE; |
| 98 | } |
| 99 | |
| 100 | if (parameters[0] == "export" && parameters.size() == 2) |
| 101 | { |
| 102 | return orders_export_command(out, parameters[1]); |
| 103 | } |
| 104 | |
| 105 | if (parameters[0] == "import" && parameters.size() == 2) |
| 106 | { |
| 107 | return orders_import_command(out, parameters[1]); |
| 108 | } |
| 109 | |
| 110 | if (parameters[0] == "clear" && parameters.size() == 1) |
| 111 | { |
| 112 | return orders_clear_command(out); |
| 113 | } |
| 114 | |
| 115 | if (parameters[0] == "sort" && parameters.size() == 1) |
| 116 | { |
| 117 | return orders_sort_command(out); |
| 118 | } |
| 119 | |
| 120 | if (parameters[0] == "recheck" && parameters.size() == 1) |
| 121 | { |
| 122 | return orders_recheck_command(out); |
| 123 | } |
| 124 | |
| 125 | if (parameters[0] == "recheck" && parameters.size() == 2) |
| 126 | { |
| 127 | if (parameters[1] == "this") |
| 128 | { |
| 129 | return orders_recheck_current_command(out); |
| 130 | } |
| 131 | } |
nothing calls this directly
no test coverage detected