Beispiel #1
0
        public override bool tryGetSecondaryNode(int id, out TezAttributeLeaf node)
        {
            if (id < m_SecondaryNodes.Count)
            {
                node = m_SecondaryNodes[id];
                return(true);
            }

            node = null;
            return(false);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
 public abstract bool tryGetSecondaryNode(int id, out TezAttributeLeaf node);
Beispiel #5
0
 public abstract void addSecondaryNode(int id, TezAttributeLeaf node);
Beispiel #6
0
 public override bool tryGetSecondaryNode(int id, out TezAttributeLeaf node)
 {
     return(m_SecondaryNodes.TryGetValue(id, out node));
 }
Beispiel #7
0
 public override void addSecondaryNode(int id, TezAttributeLeaf node)
 {
     m_SecondaryNodes.Add(id, node);
 }