コード例 #1
0
        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);
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 public Arc(Satsuma.Arc arc, string type)
 {
     this.arc  = arc;
     this.type = type;
 }
コード例 #6
0
 public bool IsEdge(Arc arc)
 {
     return(!Directed);
 }
コード例 #7
0
 public Node V(Arc arc)
 {
     return(new Node(1L + (arc.Id - 1) / nodeCount));
 }
コード例 #8
0
 public bool IsEdge(Arc arc)
 {
     return(getDirection(arc) == Direction.Edge);
 }
コード例 #9
0
 public Node V(Arc arc)
 {
     return(getDirection(arc) == Direction.Backward ? graph.U(arc) : graph.V(arc));
 }
コード例 #10
0
 public bool HasArc(Arc arc)
 {
     return(graph.HasArc(arc));
 }