public void Attach(MyAttachableConveyorEndpoint other) { var line = new MyAttachableLine(this, other); AddAttachableLine(line); other.AddAttachableLine(line); }
public bool AlreadyAttachedTo(MyAttachableConveyorEndpoint other) { foreach (var line in m_lines) { if (line.GetOtherVertex(this) == other) { return(true); } } return(false); }
public void Detach(MyAttachableConveyorEndpoint other) { for (int i = 0; i < m_lines.Count; ++i) { var line = m_lines[i]; if (line.Contains(other)) { RemoveAttachableLine(line); other.RemoveAttachableLine(line); return; } } }
public bool Contains(MyAttachableConveyorEndpoint endpoint) { return(endpoint == m_endpoint1 || endpoint == m_endpoint2); }
public MyAttachableLine(MyAttachableConveyorEndpoint endpoint1, MyAttachableConveyorEndpoint endpoint2) { m_endpoint1 = endpoint1; m_endpoint2 = endpoint2; }