예제 #1
0
 public void generate(ITezCategoryFinalToken finalToken, out TezCategory category, TezEventExtension.Function <TezCategory> onGenerate)
 {
     if (!m_Dic.TryGetValue(finalToken.toName, out category))
     {
         category = onGenerate();
         m_Dic.Add(finalToken.toName, category);
         while (finalToken.toID >= m_List.Count)
         {
             m_List.Add(null);
         }
         m_List[finalToken.toID] = category;
     }
 }
예제 #2
0
        /// <summary>
        /// 用FinalToken创建一个共用的Category
        /// </summary>
        private static TezCategory createCategory(ITezCategoryFinalToken finalToken)
        {
            Stack <ITezCategoryBaseToken> stack      = new Stack <ITezCategoryBaseToken>();
            ITezCategoryBaseToken         temp_token = finalToken;

            while (temp_token != null)
            {
                stack.Push(temp_token);
                temp_token = temp_token.parent;
            }

            TezCategory category = new TezCategory();

            category.setToken(stack.ToArray());
            return(category);
        }
예제 #3
0
        public static void generate(ITezCategoryRootToken rootToken, ITezCategoryFinalToken finalToken, out TezCategory category, TezEventExtension.Function <TezCategory> onGenerate)
        {
            if (!m_SlotDic.TryGetValue(rootToken.toName, out Slot slot))
            {
                slot = new Slot();
                while (rootToken.toID >= m_SlotList.Count)
                {
                    m_SlotList.Add(null);
                }
                m_SlotList[rootToken.toID] = slot;
                m_SlotDic.Add(rootToken.toName, slot);
            }

            slot.generate(finalToken, out category, onGenerate);
        }