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

Function getAvailableItems

plugins/buildingplan/buildingplan.cpp:707–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707static int getAvailableItems(lua_State *L) {
708 color_ostream *out = Lua::GetOutput(L);
709 if (!out)
710 out = &Core::getInstance().getConsole();
711 df::building_type type = (df::building_type)luaL_checkint(L, 1);
712 int16_t subtype = luaL_checkint(L, 2);
713 int32_t custom = luaL_checkint(L, 3);
714 int index = luaL_checkint(L, 4);
715 DEBUG(control,*out).print(
716 "entering getAvailableItems building_type={} subtype={} custom={} index={}\n",
717 ENUM_AS_STR(type), subtype, custom, index);
718 vector<int> item_ids;
719 scanAvailableItems(*out, type, subtype, custom, index, true, false, NULL, &item_ids);
720 Lua::PushVector(L, item_ids);
721 return 1;
722}
723
724static int getAvailableItemsByHeat(lua_State *L) {
725 color_ostream *out = Lua::GetOutput(L);

Callers

nothing calls this directly

Calls 3

scanAvailableItemsFunction · 0.85
PushVectorFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected