| 133 | // |
| 134 | |
| 135 | static bool sort_proxy(const item_or_unit &a, const item_or_unit &b) { |
| 136 | if (std::holds_alternative<df::item*>(a) || std::holds_alternative<df::item*>(b)) |
| 137 | return true; |
| 138 | |
| 139 | bool ret = true; |
| 140 | color_ostream &out = Core::getInstance().getConsole(); |
| 141 | Lua::CallLuaModuleFunction(out, "plugins.sort", "do_sort", |
| 142 | std::make_tuple(std::get<df::unit*>(a), std::get<df::unit*>(b)), |
| 143 | 1, [&](lua_State *L){ |
| 144 | ret = lua_toboolean(L, 1); |
| 145 | } |
| 146 | ); |
| 147 | return ret; |
| 148 | } |
| 149 | |
| 150 | static sort_entry do_sort{ |
| 151 | sort_proxy, |
nothing calls this directly
no test coverage detected