MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / containerIndexInteger

Function containerIndexInteger

framework/luaframework.h:408–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408template <typename C> int containerIndexInteger(lua_State *L)
409{
410 C **v = (C **)lua_touserdata(L, 1);
411 int i = luaL_checkinteger(L, 2);
412 lua_settop(L, 0);
413 --i; // lua indices start at 1
414 if (i >= 0 && i < (*v)->size())
415 {
416 pushToLua(L, (*v)->operator[](i));
417 }
418 else
419 {
420 lua_pushnil(L);
421 }
422 return 1;
423}
424template <typename C> int containerIndexMap(lua_State *L)
425{
426 C **v = (C **)lua_touserdata(L, 1);

Callers

nothing calls this directly

Calls 3

pushToLuaFunction · 0.70
sizeMethod · 0.45
operator[]Method · 0.45

Tested by

no test coverage detected