Exemplo n.º 1
0
        public override void StartWithTarget(CCNode target)
        {
            base.StartWithTarget(target);

            CCNode t = m_pTarget;
            CCGridBase targetGrid = t.Grid;

            if (targetGrid != null && targetGrid.ReuseGrid > 0)
            {
                Grid = targetGrid;

                if (targetGrid.Active && targetGrid.GridSize.X == m_sGridSize.X
                    && targetGrid.GridSize.Y == m_sGridSize.Y /*&& dynamic_cast<CCGridBase*>(targetGrid) != NULL*/)
                {
                    targetGrid.Reuse();
                }
                else
                {
                    Debug.Assert(false);
                }
            }
            else
            {
                if (targetGrid != null && targetGrid.Active)
                {
                    targetGrid.Active = false;
                }

                CCGridBase newgrid = Grid;

                t.Grid = newgrid;
                t.Grid.Active = true;
            }
        }
Exemplo n.º 2
0
        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);

            CCGridBase newgrid = this.getGrid();

            CCNode     t          = m_pTarget;
            CCGridBase targetGrid = t.Grid;

            if (targetGrid != null && targetGrid.ReuseGrid > 0)
            {
                if (targetGrid.Active && targetGrid.GridSize.x == m_sGridSize.x &&
                    targetGrid.GridSize.y == m_sGridSize.y)
                {
                    targetGrid.reuse();
                }
            }
            else
            {
                if (targetGrid != null && targetGrid.Active)
                {
                    targetGrid.Active = false;
                }

                t.Grid        = newgrid;
                t.Grid.Active = true;
            }
        }
Exemplo n.º 3
0
        public static CCGridBase gridWithSize(ccGridSize gridSize)
        {
            CCGridBase cCGridBase = new CCGridBase();

            if (cCGridBase.initWithSize(gridSize))
            {
                return(cCGridBase);
            }
            return(null);
        }
Exemplo n.º 4
0
        public static CCGridBase gridWithSize(ccGridSize gridSize, CCTexture2D texture, bool flipped)
        {
            CCGridBase cCGridBase = new CCGridBase();

            if (cCGridBase.initWithSize(gridSize, texture, flipped))
            {
                return(cCGridBase);
            }
            return(null);
        }
Exemplo n.º 5
0
        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);
            CCGridBase grid = this.m_pTarget.Grid;

            if (grid != null && grid.Active)
            {
                grid.Active = false;
            }
        }
Exemplo n.º 6
0
        public override void StartWithTarget(Node pTarget)
        {
            base.StartWithTarget(pTarget);

            CCGridBase pGrid = Target.Grid;

            if (pGrid != null && pGrid.Active)
            {
                pGrid.Active = false;
            }
        }
Exemplo n.º 7
0
        public static CCGridBase gridWithSize(ccGridSize gridSize, Texture texture, bool flipped)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase.initWithSize(gridSize, texture, flipped))
            {
                return pGridBase;
            }

            return null;
        }
Exemplo n.º 8
0
        public static CCGridBase gridWithSize(ccGridSize gridSize, CCTexture2D texture, bool flipped)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase != null)
            {
                if (pGridBase.initWithSize(gridSize, texture, flipped))
                {
                    //pGridBase->autorelease();
                }
                else
                {
                    //CC_SAFE_RELEASE_NULL(pGridBase);
                }
            }

            return pGridBase;
        }
Exemplo n.º 9
0
        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);
            CCGridBase grid       = this.getGrid();
            CCNode     mPTarget   = this.m_pTarget;
            CCGridBase cCGridBase = mPTarget.Grid;

            if (cCGridBase == null || cCGridBase.ReuseGrid <= 0)
            {
                if (cCGridBase != null && cCGridBase.Active)
                {
                    cCGridBase.Active = false;
                }
                mPTarget.Grid        = grid;
                mPTarget.Grid.Active = true;
            }
            else if (cCGridBase.Active && cCGridBase.GridSize.x == this.m_sGridSize.x && cCGridBase.GridSize.y == this.m_sGridSize.y)
            {
                cCGridBase.reuse();
                return;
            }
        }
Exemplo n.º 10
0
        public static CCGridBase gridWithSize(ccGridSize gridSize)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase.initWithSize(gridSize))
            {
                return pGridBase;
            }

            return null;
        }
Exemplo n.º 11
0
        public static CCGridBase gridWithSize(ccGridSize gridSize)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase != null)
            {
                if (pGridBase.initWithSize(gridSize))
                {
                    //pGridBase->autorelease();
                }
                else
                {
                    //CC_SAFE_RELEASE_NULL(pGridBase);
                }
            }

            return pGridBase;
        }