public override bool tryGetPrimaryNode(int id, out TezAttributeNode node) { if (id < m_PrimaryNodes.Count) { node = m_PrimaryNodes[id]; return(true); } node = null; return(false); }
protected TezAttributeNode getOrCreatePrimaryNode(ITezAttributeToken token) { var id = token.tokenID; TezAttributeNode node = null; if (!m_Container.tryGetPrimaryNode(id, out node)) { node = this.onCreatePrimaryChild(token); m_Container.addPrimaryNode(id, node); } return(node); }
protected TezAttributeNode getOrCreatePrimaryNode(ITezAttributeToken token, ref TezAttributePath pre_path_node) { var id = token.tokenID; TezAttributeNode node = null; if (!m_Container.tryGetPrimaryNode(id, out node)) { node = this.onCreatePrimaryChild(token); m_Container.addPrimaryNode(id, node); pre_path_node?.addChild(id); } if (node.nodeType == TezAttributeNodeType.Path) { pre_path_node = (TezAttributePath)node; } return(node); }
public override void addPrimaryNode(int id, TezAttributeNode node) { ///id = 7 实际为第8个 ///Count = 5 ///rc = 2 /// var remain_count = m_PrimaryNodes.Count - id; if (remain_count > 0) { m_PrimaryNodes[id] = node; } else if (remain_count == 0) { m_PrimaryNodes.Add(node); } else { remain_count = -remain_count + 1; m_PrimaryNodes.AddRange(new TezAttributeNode[remain_count]); m_PrimaryNodes[id] = node; } }
public abstract bool tryGetPrimaryNode(int id, out TezAttributeNode node);
public override bool tryGetPrimaryNode(int id, out TezAttributeNode node) { return(m_PrimaryNodes.TryGetValue(id, out node)); }
public abstract void addPrimaryNode(int id, TezAttributeNode node);
public override void addPrimaryNode(int id, TezAttributeNode node) { m_PrimaryNodes.Add(id, node); }