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

Method initializeModules

source/game/StarTechController.cpp:451–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void TechController::initializeModules() {
452 for (auto& module : m_techModules) {
453 module.scriptComponent.addCallbacks("tech", makeTechCallbacks(module));
454 module.scriptComponent.addCallbacks("config", LuaBindings::makeConfigCallbacks([&module](String const& name, Json const& def) {
455 return module.config.parameters.query(name, def);
456 }));
457 module.scriptComponent.addCallbacks("entity", LuaBindings::makeEntityCallbacks(m_parentEntity));
458 module.scriptComponent.addCallbacks("animator", LuaBindings::makeNetworkedAnimatorCallbacks(&m_techAnimators.getNetElement(module.animatorId)->animator));
459 module.scriptComponent.addCallbacks("status", LuaBindings::makeStatusControllerCallbacks(m_statusController));
460 if (auto player = as<Player>(m_parentEntity))
461 module.scriptComponent.addCallbacks("player", LuaBindings::makePlayerCallbacks(player));
462 module.scriptComponent.addActorMovementCallbacks(m_movementController);
463
464 module.scriptComponent.init(m_parentEntity->world());
465 }
466}
467
468void TechController::resetMoves() {
469 m_moveRun = false;

Callers

nothing calls this directly

Calls 6

getNetElementMethod · 0.80
addCallbacksMethod · 0.45
queryMethod · 0.45
initMethod · 0.45
worldMethod · 0.45

Tested by

no test coverage detected