/// <summary> /// Compares edges using <see cref="StartNode"/>, <see cref="EndNode"/>, <see cref="Distance"/> properties. /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { var edge = obj as IEdge <T>; return(StartNode.Equals(edge.StartNode) && EndNode.Equals(edge.EndNode) && Distance.Equals(edge.Distance)); }
public override bool Equals(object O) { Arc A = (Arc)O; if (A == null) { throw new ArgumentException("Cannot compare " + GetType() + " with " + O.GetType()); } return(StartNode.Equals(A.StartNode) && EndNode.Equals(A.EndNode)); }