示例#1
0
        private void InitCells()
        {
            // init array
            m_Cells = new Cell[BoardWidth, BoardHeight];

            // assign new cell to each element
            for (int y = 0; y < BoardHeight; y++)
            {
                for (int x = 0; x < BoardWidth; x++)
                {
                    m_Cells[x, y] = new Cell();
                }
            }

            // clear the game board
            Clear();
        }
示例#2
0
        // copy another cell's state to this cell
        public void Copy(Cell cell)
        {
            // copy public properties
            ColorIndex = cell.ColorIndex;
            IsClearing = cell.IsClearing;
            IsFalling = cell.IsFalling;

            // also need to copy state data since Cell.Copy() may have
            // been called from GameBoard.NewRow() and reseting these
            // values will make the gravity animation seem choppy
            m_ClearAge = cell.m_ClearAge;
            m_FallAge = cell.m_FallAge;
        }