Exemple #1
0
        public void Split(ILinkData point)
        {
            int        index    = this.childrenInt.IndexOf(point);
            ILinkGroup newGroup = new LinkGroup(this.childrenInt.Skip(index + 1));

            newGroup.RecalculateCenter();
            this.childrenInt.RemoveRange(index, this.childrenInt.Count - index);
            this.RecalculateCenter();
        }
        public static void DetachGroupAround(ILinkData delObj)
        {
            ILinkGroup parent = delObj.GroupParent;

            if (parent.Children.Count() <= 1)
            {
                return;
            }
            if (parent.Children.First() == delObj || parent.Children.Last() == delObj)
            {
                parent.Remove(delObj);
                parent.RecalculateCenter();
            }
            else
            {
                parent.Split(delObj);
            }
            delObj.Reset();
            ILinkGroup result = new LinkGroup(delObj);
        }
        public static void Notify_LinkableSpawned(ILinkData newObj)
        {
            ILinkGroup result = new LinkGroup(newObj);

            LinkGroupUtility.AttachGroupAround(newObj);
        }