// Cable is controller, manages connections on ports public void connectToHead(CablePort p) { MyAPIGateway.Utilities.ShowNotification("connect to cableparentport"); MyLog.Default.WriteLine("Cable: connecting to parent/head"); p.connectCable(this); if (headPort != null && headPort.cable != null) // reset if occupied { headPort.breakCable(); } headPort = p; storage.parentPortId = p.Entity.EntityId; }
public void connectToTail(CablePort p) { MyAPIGateway.Utilities.ShowNotification("connect to cablechildport"); MyLog.Default.WriteLine("Cable: connecting to child/Tail"); p.connectCable(this); if (tailPort != null && tailPort.cable != null) { tailPort.breakCable(); } tailPort = p; storage.childPortId = p.Entity.EntityId; // if connecting childport to another block; link, store cable if (p.isWelder) { } else { linkGrids(); } }