namespace HeuristicLab.Problems.RoutePlanning.Graph { public class OsmVertex { private static long idCounter = 0; private long id; public long Id { get { return id; } } private T node; public T Node { get { return node; } } public OsmVertex(T node) { this.node = node; this.id = idCounter++; } public static bool operator ==(OsmVertex v1, OsmVertex v2) { if ((object)v1 == null) { if ((object)v2 == null) { return true; } return false; } if ((object)v1 == null && (object)v2 != null) { return false; } return v1.Equals(v2); } public static bool operator !=(OsmVertex v1, OsmVertex v2) { return !(v1 == v2); } public override bool Equals(object obj) { if (obj is OsmVertex) { OsmVertex graph = (obj as OsmVertex); return this.Equals(graph); } return false; } public override int GetHashCode() { return typeof(T).GetHashCode() ^ this.Node.GetHashCode(); } public override string ToString() { return string.Format("{0}", this.Node); } } }