GameUILibrary.Tetris.GetMatrix C# (CSharp) Method

GetMatrix() public method

public GetMatrix ( ) : ushort
return ushort
        public ushort GetMatrix()
        {
            return Matrixs.Peek();
        }

Usage Example

Ejemplo n.º 1
0
        private void HideCurrentTetris()
        {
            TetrisBlock[,] blocks = m_blocks;
            Tetris tetris = m_tetris;
            ushort matrix = tetris.GetMatrix();
            int    b      = TETRIS_MAX_M * TETRIS_MAX_N - 1;

            for (int i = 0; i < TETRIS_MAX_M; ++i)
            {
                for (int j = 0; j < TETRIS_MAX_N; ++j)
                {
                    int offset = b - (i * TETRIS_MAX_N + j);
                    int row    = i + m_row;
                    int col    = j + m_col;
                    if (row < 0 || row >= TETRIS_MAX_ROWS || col < 0 || col >= TETRIS_MAX_COLUMNS)
                    {
                        continue;
                    }

                    if (((matrix >> offset) & 1) == 1)
                    {
                        blocks[row, col].Fill = null;
                    }
                }
            }
        }
All Usage Examples Of GameUILibrary.Tetris::GetMatrix