/// <summary>
 /// Хранение разъема для грани в "встроенных" связанном списке
 /// </summary>
 public void DepositConnector(FaceConnector connector)
 {
     if (ConnectorStack == null)
     {
         connector.Next = null;
         ConnectorStack = connector;
     }
     else
     {
         connector.Next = ConnectorStack;
         ConnectorStack = connector;
     }
 }
        /// <summary>
        /// Получить неиспользуемые разъем для грани. Если ни один не доступен, создать его.
        /// </summary>
        public FaceConnector GetConnector()
        {
            if (ConnectorStack == null)
            {
                return(new FaceConnector(Dimension));
            }

            var ret = ConnectorStack;

            ConnectorStack = ConnectorStack.Next;
            ret.Next       = null;
            return(ret);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Добавляет грань в список
 /// </summary>
 public void Add(FaceConnector element)
 {
     if (last != null)
     {
         last.Next = element;
     }
     element.Previous = last;
     last             = element;
     if (first == null)
     {
         first = element;
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Удаляет элемент из списка
        /// </summary>
        public void Remove(FaceConnector connector)
        {
            if (connector.Previous != null)
            {
                connector.Previous.Next = connector.Next;
            }
            else if (connector.Previous == null)
            {
                first = connector.Next;
            }

            if (connector.Next != null)
            {
                connector.Next.Previous = connector.Previous;
            }
            else if (connector.Next == null)
            {
                last = connector.Previous;
            }

            connector.Next     = null;
            connector.Previous = null;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Добавляет элемент в начало
 /// </summary>
 void AddFirst(FaceConnector connector)
 {
     first.Previous = connector;
     connector.Next = first;
     first          = connector;
 }