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

Method addNodeConnection

source/game/StarObject.cpp:798–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796}
797
798void Object::addNodeConnection(WireNode wireNode, WireConnection nodeConnection) {
799 if (wireNode.direction == WireDirection::Input) {
800 m_inputNodes.at(wireNode.nodeIndex).connections.update([&](auto& list) {
801 if (list.contains(nodeConnection))
802 return false;
803 list.append(nodeConnection);
804 return true;
805 });
806 } else {
807 m_outputNodes.at(wireNode.nodeIndex).connections.update([&](auto& list) {
808 if (list.contains(nodeConnection))
809 return false;
810 list.append(nodeConnection);
811 return true;
812 });
813 }
814 m_scriptComponent.invoke("onNodeConnectionChange");
815}
816
817void Object::removeNodeConnection(WireNode wireNode, WireConnection nodeConnection) {
818 if (wireNode.direction == WireDirection::Input) {

Callers 2

connectWireGroupMethod · 0.80
handleIncomingPacketsMethod · 0.80

Calls 5

updateMethod · 0.45
atMethod · 0.45
containsMethod · 0.45
appendMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected