void resetConnector(string name) { AutoConnectionServer connector = this.autoConnectors.FirstOrDefault(c => c.Name == name); if (connector != null) { connector.Reset(); } }
void disconnect(long address) { AutoConnectionServer connector = this.autoConnectors.FirstOrDefault(con => con.HasPendingRequest(address)); if (connector != null) { this.log($"found eligible connector for disconnection: '{connector.Name}'"); connector.Disconnect(address); } else { this.log("found no eligible connector"); } }
void connect(MyCubeSize size, Vector3D wPos, Vector3D wOrientation, long address) { Vector3D pos = this.transformer.Pos(wPos); Vector3D orientation = this.transformer.Dir(wOrientation); AutoConnectionServer connector = this.autoConnectors.FirstOrDefault(con => con.IsInRange(pos)); if (connector != null) { this.log($"found eligible connector for connection: '{connector.Name}'"); connector.Connect(new ConnectionRequest { Address = address, Orientation = orientation, Position = pos, Size = size }); } else { this.log("found no eligible connector"); } }