Ejemplo n.º 1
0
 public void CopyFlags(YndLink link)
 {
     if (link == null)
     {
         return;
     }
     Flags0 = link.Flags0;
     Flags1 = link.Flags1;
     Flags2 = link.Flags2;
 }
Ejemplo n.º 2
0
        public bool RemoveLink(YndLink l)
        {
            List <YndLink> newlinks = new List <YndLink>();
            int            cnt      = Links?.Length ?? 0;
            bool           r        = false;

            for (int i = 0; i < cnt; i++)
            {
                var tl = Links[i];
                if (tl != l)
                {
                    newlinks.Add(tl);
                }
                else
                {
                    r = true;
                }
            }
            Links     = newlinks.ToArray();
            LinkCount = newlinks.Count;
            return(r);
        }
Ejemplo n.º 3
0
        public YndLink AddLink(YndNode tonode = null)
        {
            YndLink l = new YndLink();

            l._RawData.AreaID = AreaID;
            l.Node1           = this;
            if (tonode != null)
            {
                l.Node2           = tonode;
                l._RawData.AreaID = tonode.AreaID;
                l._RawData.NodeID = tonode.NodeID;
            }
            else if ((Ynd.Nodes != null) && (Ynd.Nodes.Length > 0))
            {
                l.Node2 = Ynd.Nodes[0];
            }
            else
            {
                l.Node2           = this;
                l._RawData.NodeID = NodeID;
            }
            l.UpdateLength();

            int cnt  = Links?.Length ?? 0;
            int ncnt = cnt + 1;

            YndLink[] nlinks = new YndLink[ncnt];
            for (int i = 0; i < cnt; i++)
            {
                nlinks[i] = Links[i];
            }
            nlinks[cnt] = l;
            Links       = nlinks;
            LinkCount   = ncnt;

            return(l);
        }