public static int registerToken(ITezCategoryBaseToken baseToken) { var id = m_TokenDic.Count; m_TokenDic.Add(baseToken.toName, baseToken); return(id); }
protected TezCategoryBaseToken(TValue value, int layer, ITezCategoryBaseToken parent) : base(value) { this.layer = layer; this.parent = parent; this.UID = TezCategorySystem.registerToken(this); // Debug.Log(string.Format("{0}:{1}", this.toName, this.UID)); }
/// <summary> /// 检测Category是否包含此类型 /// </summary> public bool contains(ITezCategoryBaseToken token) { if (token.layer < m_Tokens.Length) { return(m_Tokens[token.layer].Equals(token)); } return(false); }
/// <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); }
public Table getTable(ITezCategoryBaseToken baseToken) { return(m_TableList[baseToken.UID]); }
protected TezCategoryFinalToken(TValue value, ITezCategoryBaseToken parentToken) : base(value, parentToken.layer + 1, parentToken) { }
private Equipment(Category value, ITezCategoryBaseToken parentToken) : base(value, parentToken) { }
private T7(Category value, ITezCategoryBaseToken parentToken) : base(value, parentToken) { }