コード例 #1
0
        // addChild helper, faster than insertChild
        public void AppendChild(CCSprite sprite)
        {
            IsReorderChildDirty = true;

            if (TextureAtlas.TotalQuads == TextureAtlas.Capacity)
            {
                IncreaseAtlasCapacity();
            }

            Descendants.Add(sprite);

            int index = Descendants.Count - 1;

            sprite.AtlasIndex = index;
            sprite.BatchNode  = this;

            TextureAtlas.UpdateQuad(ref sprite.transformedQuad, index);

            // add children recursively
            CCRawList <CCNode> children = sprite.Children;

            if (children != null && children.Count > 0)
            {
                CCNode[] elements = children.Elements;
                int      count    = children.Count;
                for (int i = 0; i < count; i++)
                {
                    AppendChild((CCSprite)elements[i]);
                }
            }
        }
コード例 #2
0
 public void AddSubsymbol(ISymbolInformation child)
 {
     if (Descendants == null)
     {
         Descendants = new List <ISymbolInformation>();
     }
     Descendants.Add(child);
 }
コード例 #3
0
ファイル: ASTNode.cs プロジェクト: murray-coueslant/CMPT432
 public void AddDescendant(ASTNode node)
 {
     Descendants.Add(node);
     node.Parent = this;
 }