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

Function logistics_getStockpileConfigs

plugins/logistics.cpp:733–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733static int logistics_getStockpileConfigs(lua_State *L) {
734 color_ostream *out = Lua::GetOutput(L);
735 if (!out)
736 out = &Core::getInstance().getConsole();
737 DEBUG(control, *out).print("entering logistics_getStockpileConfigs\n");
738
739 unordered_map<df::building_stockpilest*, PersistentDataItem> cache;
740 validate_stockpile_configs(*out, cache);
741
742 vector<df::building_stockpilest*> sps;
743 find_stockpiles(L, 1, sps);
744 if (sps.empty())
745 return 0;
746
747 vector<unordered_map<string, int>> configs;
748 for (auto sp : sps)
749 configs.emplace_back(get_stockpile_config(sp->stockpile_number));
750 Lua::PushVector(L, configs);
751 return 1;
752}
753
754static void logistics_setStockpileConfig(color_ostream& out, int stockpile_number,
755 bool melt, bool trade,

Callers

nothing calls this directly

Calls 6

find_stockpilesFunction · 0.85
get_stockpile_configFunction · 0.85
PushVectorFunction · 0.85
printMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected