MCPcopy Create free account
hub / github.com/DFHack/dfhack / orders_clear_command

Function orders_clear_command

plugins/orders.cpp:973–1002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971}
972
973static command_result orders_clear_command(color_ostream & out)
974{
975 for (auto order : world->manager_orders.all)
976 {
977 for (auto condition : order->item_conditions)
978 {
979 delete condition;
980 }
981 for (auto condition : order->order_conditions)
982 {
983 delete condition;
984 }
985 if (order->items)
986 {
987 for (auto item : order->items->elements)
988 {
989 delete item;
990 }
991 delete order->items;
992 }
993
994 delete order;
995 }
996
997 out << "Deleted " << world->manager_orders.all.size() << " manager orders." << std::endl;
998
999 world->manager_orders.all.clear();
1000
1001 return CR_OK;
1002}
1003
1004static bool orders_compare(df::manager_order *a, df::manager_order *b)
1005{

Callers 1

orders_commandFunction · 0.85

Calls 2

sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected