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

Method New

library/LuaTools.cpp:1527–1537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1525}
1526
1527void DFHack::Lua::Event::New(lua_State *state, Owner *owner)
1528{
1529 auto obj = (EventObject *)lua_newuserdata(state, sizeof(EventObject));
1530 obj->item_count = 0;
1531 obj->owner = owner;
1532
1533 lua_rawgetp(state, LUA_REGISTRYINDEX, &DFHACK_EVENT_META_TOKEN);
1534 lua_setmetatable(state, -2);
1535 lua_newtable(state);
1536 lua_setuservalue(state, -2);
1537}
1538
1539void DFHack::Lua::Event::SetPrivateCallback(lua_State *L, int event)
1540{

Callers 2

make_inFunction · 0.45
make_outFunction · 0.45

Calls 4

lua_newuserdataFunction · 0.85
lua_rawgetpFunction · 0.85
lua_setmetatableFunction · 0.85
lua_setuservalueFunction · 0.85

Tested by

no test coverage detected