Esempio n. 1
0
 private static void DestroyNodeByPool(LoaderGroupNode node)
 {
     if (node == null)
     {
         return;
     }
     InitPool();
     node.Reset();
     m_NodePool.Store(node);
 }
Esempio n. 2
0
        private void AddLoadNode(LoaderGroupKey key, LoaderGroupNode node)
        {
            if (node == null)
            {
                return;
            }

            var loadList = this.LoadList;
            var loadMap  = this.LoadMap;

            var checkNode    = loadList.First;
            var currentDepth = node.GetFirstDepth();

            while (checkNode != null)
            {
                var checkDepth = checkNode.Value.GetFirstDepth();
                if (currentDepth < checkDepth)
                {
                    break;
                }
                checkNode = checkNode.Next;
            }

            // 保护一下
            var linkListNode = node.LinkListNode;

            if (linkListNode.List != null)
            {
                linkListNode.List.Remove(linkListNode);
            }
            //-----------------------

            if (checkNode != null)
            {
                loadList.AddBefore(checkNode, linkListNode);
            }
            else
            {
                loadList.AddLast(linkListNode);
            }

            loadMap.Add(key, node);
        }