Exemplo n.º 1
0
        /// <summary>
        /// Adds the connection between two vertices.
        /// </summary>
        /// <param name="a">a.</param>
        /// <param name="b">The b.</param>
        public void AddConnection(JGVertex a, JGVertex b)
        {
            JGVertex A = null;
            JGVertex B = null;

            dict.TryGetValue(a.GetHashCode(), out A);
            dict.TryGetValue(b.GetHashCode(), out B);
            if (A != null && B != null)
            {
                A.AddToConnections(B);
                B.AddToConnections(A);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds a vertex.
 /// </summary>
 /// <param name="vertex">The vertex.</param>
 public void AddVertex(JGVertex vertex)
 {
     dict.Add(vertex.GetHashCode(), vertex);
     this.Vertices.Add(vertex);
 }