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

Function PushVector

library/include/LuaTools.h:403–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401
402 template<typename T>
403 void PushVector(lua_State *state, const T &pvec, bool addn = false)
404 {
405 lua_createtable(state,pvec.size(), addn?1:0);
406
407 if (addn)
408 {
409 lua_pushinteger(state, pvec.size());
410 lua_setfield(state, -2, "n");
411 }
412
413 for (size_t i = 0; i < pvec.size(); i++)
414 {
415 Push(state, pvec[i]);
416 lua_rawseti(state, -2, i+1);
417 }
418 }
419
420 template<typename T>
421 void Push(lua_State *state, const std::vector<T> &vec) {

Callers 15

ls_helperFunction · 0.85
getCommandHistoryFunction · 0.85
gui_getFocusStringsFunction · 0.85
gui_getCurFocusFunction · 0.85
gui_getWidgetChildrenFunction · 0.85
job_listNewlyCreatedFunction · 0.85
textures_loadTilesetFunction · 0.85
textures_createTilesetFunction · 0.85
units_getNoblePositionsFunction · 0.85
units_getUnitsInBoxFunction · 0.85
units_getCitizensFunction · 0.85

Calls 6

lua_createtableFunction · 0.85
lua_pushintegerFunction · 0.85
lua_setfieldFunction · 0.85
PushFunction · 0.85
lua_rawsetiFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected