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

Function AddContainerMethodFun

library/LuaTypes.cpp:1641–1650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639}
1640
1641static void AddContainerMethodFun(lua_State *state, int meta_idx, int field_idx,
1642 lua_CFunction function, const char *name,
1643 const type_identity *container, const type_identity *item, int count)
1644{
1645 lua_pushfstring(state, "%s()", name);
1646 SetContainerMethod(state, meta_idx, lua_gettop(state), function, name, container, item, count);
1647 lua_pop(state, 1);
1648
1649 EnableMetaField(state, field_idx, name);
1650}
1651
1652/**
1653 * Make a container-style object metatable.

Callers 1

MakeContainerMetatableFunction · 0.85

Calls 2

lua_pushfstringFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected