MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addCallbacks

Method addCallbacks

source/game/scripting/StarLuaComponents.cpp:36–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void LuaBaseComponent::addCallbacks(String groupName, LuaCallbacks callbacks) {
37 if (!m_callbacks.insert(groupName, callbacks).second)
38 throw LuaComponentException::format("Duplicate callbacks named '{}' in LuaBaseComponent", groupName);
39
40 if (m_context)
41 m_context->setCallbacks(groupName, callbacks);
42}
43
44bool LuaBaseComponent::removeCallbacks(String const& groupName) {
45 if (m_callbacks.remove(groupName)) {

Callers

nothing calls this directly

Calls 3

setCallbacksMethod · 0.80
formatFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected