public Arc AddArc(Node nodeA, Node nodeB, string type)
        {
            Satsuma.Arc arc  = baseGraph.AddArc(nodeA.node, nodeB.node, Directedness.Undirected);
            Arc         arc2 = new Arc(arc, type);

            arcList.Add(arc2);
            return(arc2);
        }
 public Edge(Satsuma.Arc arc, Corner c0, Corner c1)
     : base(arc, WorldGenTags.Edge.Name)
 {
     corner0 = c0;
     corner1 = c1;
     c0.Add(this);
     c1.Add(this);
     tags = new TagSet();
 }
 public Edge(Satsuma.Arc arc, Corner c0, Corner c1, Cell s0, Cell s1)
     : base(arc, WorldGenTags.Edge.Name)
 {
     corner0 = c0;
     corner1 = c1;
     site0   = s0;
     site1   = s1;
     c0.Add(this);
     c1.Add(this);
     s0.Add(this);
     s1.Add(this);
     tags = new TagSet();
 }
        public Edge GetEdge(Corner corner0, Corner corner1, Cell site0, Cell site1, bool createOK, out bool didCreate)
        {
            Edge edge = null;

            didCreate = false;
            edge      = edgeList.Find((Edge e) => (e.corner0 == corner0 && e.corner1 == corner1) || (e.corner1 == corner0 && e.corner0 == corner1));
            if (edge != null)
            {
                return(edge);
            }
            if (!createOK)
            {
                Debug.LogWarning("Cant create Edge but no edge found");
                return(null);
            }
            Satsuma.Arc arc = base.baseGraph.AddArc(corner0.node, corner1.node, Directedness.Undirected);
            edge = new Edge(arc, corner0, corner1, site0, site1);
            arcList.Add(edge);
            edgeList.Add(edge);
            didCreate = true;
            return(edge);
        }
Esempio n. 5
0
 public Arc(Satsuma.Arc arc, string type)
 {
     this.arc  = arc;
     this.type = type;
 }
Esempio n. 6
0
 public bool IsEdge(Arc arc)
 {
     return(!Directed);
 }
Esempio n. 7
0
 public Node V(Arc arc)
 {
     return(new Node(1L + (arc.Id - 1) / nodeCount));
 }
Esempio n. 8
0
 public bool IsEdge(Arc arc)
 {
     return(getDirection(arc) == Direction.Edge);
 }
Esempio n. 9
0
 public Node V(Arc arc)
 {
     return(getDirection(arc) == Direction.Backward ? graph.U(arc) : graph.V(arc));
 }
Esempio n. 10
0
 public bool HasArc(Arc arc)
 {
     return(graph.HasArc(arc));
 }