public override bool tryGetSecondaryNode(int id, out TezAttributeLeaf node) { if (id < m_SecondaryNodes.Count) { node = m_SecondaryNodes[id]; return(true); } node = null; return(false); }
protected TezAttributeLeaf getOrCreateSecondaryNode(ITezAttributeToken token) { var id = token.tokenID; TezAttributeLeaf node = null; if (!m_Container.tryGetSecondaryNode(id, out node)) { node = this.onCreateSecondaryChild(token); m_Container.addSecondaryNode(id, node); } return(node); }
public override void addSecondaryNode(int id, TezAttributeLeaf node) { var remain_count = m_SecondaryNodes.Count - id; if (remain_count > 0) { m_SecondaryNodes[id] = node; } else if (remain_count == 0) { m_SecondaryNodes.Add(node); } else { remain_count = -remain_count + 1; m_SecondaryNodes.AddRange(new TezAttributeLeaf[remain_count]); m_SecondaryNodes[id] = node; } }
public abstract bool tryGetSecondaryNode(int id, out TezAttributeLeaf node);
public abstract void addSecondaryNode(int id, TezAttributeLeaf node);
public override bool tryGetSecondaryNode(int id, out TezAttributeLeaf node) { return(m_SecondaryNodes.TryGetValue(id, out node)); }
public override void addSecondaryNode(int id, TezAttributeLeaf node) { m_SecondaryNodes.Add(id, node); }