// Removes every node in the given list
 private void DestroyEntireList(ContainerList list)
 {
     while (list.Size != 0)
     {
         this.DestroyFrontOfList(list);
     }
 }
        ///////////////////////////////////////////////////////
        //
        // Private Methods
        //
        ///////////////////////////////////////////////////////

        // Removes the first node in the given list and clears its data
        private void DestroyFrontOfList(ContainerList list)
        {
            if (list.Size <= 0)
            {
                return;
            }

            ContainerNode toBeDeleted = list.PopFront();

            toBeDeleted.Reset();
            toBeDeleted.BaseReset();
            toBeDeleted.next = null;
            toBeDeleted.prev = null;
            toBeDeleted      = null;
        }
        /// <summary>
        ///     Iterate through a list and retrieve it's inqured enum value with instance ID
        /// </summary>
        /// <param name="query"></param>
        /// <param name="id"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        protected ContainerNode BaseFind(Enum query, uint id, ContainerList list)
        {
            ContainerNode foundNode = null;

            ContainerNode itr = list.Head;

            while (itr != null)
            {
                if (itr.GetName().Equals(query))
                {
                    if (itr.Id == id)
                    {
                        // Found node
                        foundNode = itr;
                        break;
                    }
                }

                // Next node
                itr = itr.next;
            }

            return(foundNode);
        }
 public Container(ListNode newPrev, ListNode newNext, uint newId)
     : base(newPrev, newNext, newId)
 {
     this.activeList   = new ContainerList();
     this.reservedList = new ContainerList();
 }
 public Container(uint newId)
     : base(newId)
 {
     this.activeList   = new ContainerList();
     this.reservedList = new ContainerList();
 }
 // Move the given node from one list to another
 private void Move(ContainerNode node, ContainerList fromList, ContainerList toList)
 {
     Debug.Assert(ReferenceEquals(fromList, toList) == false);
     node = fromList.Pop(node);
     toList.PushFront(node);
 }
        ///////////////////////////////////////////////////////
        //
        // Constructors
        //
        ///////////////////////////////////////////////////////

        public Container() : base()
        {
            this.activeList   = new ContainerList();
            this.reservedList = new ContainerList();
        }