Example #1
0
        public Piece(string shape)
        {
            StringToMatrix s2m = new StringToMatrix(shape);

            blocks  = s2m.blocks;
            rows    = s2m.rows;
            columns = s2m.columns;
        }
Example #2
0
        public Piece(string piece)
        {
            StringToMatrix s_m = new StringToMatrix(piece);

            blocks = s_m.blocks;
            rows   = s_m.rows;
            cols   = s_m.cols;
        }
Example #3
0
        public void FromString(string s)
        {
            StringToMatrix converter = new StringToMatrix(s);

            board   = converter.blocks;
            rows    = converter.rows;
            columns = converter.columns;
        }
Example #4
0
        public Piece(string shape)
        {
            StringToMatrix s = new StringToMatrix(shape);

            this.rows    = s.rows;
            this.columns = s.columns;
            this.blocks  = s.matrix;
        }
Example #5
0
        public void FromString(string blocks)
        {
            StringToMatrix stm = new StringToMatrix(blocks);

            this.board   = stm.matrix;
            this.rows    = stm.rows;
            this.columns = stm.columns;
        }
Example #6
0
        public Piece(string s)           // convert a "...\n...\n...\n" string into a matrix
        {
            StringToMatrix s2m = new StringToMatrix(s);

            blocks  = s2m.blocks;
            rows    = s2m.rows;
            columns = s2m.columns;
        }
Example #7
0
        public void FromString(string blocks)
        {
            StringToMatrix sm = new StringToMatrix(blocks);

            board = sm.blocks;
            Rows  = sm.rows;
            Cols  = sm.cols;
        }
Example #8
0
        public void FromString(String blocks)
        {
            StringToMatrix converter = new StringToMatrix(blocks);

            board   = converter.blocks;
            Rows    = converter.rows;
            Columns = converter.columns;
        }
Example #9
0
        public override String ToString()
        {
            char[,] curr_board = new char[Rows(), Columns()];
            for (int r = 0; r < Rows(); r++)
            {
                for (int c = 0; c < Columns(); c++)
                {
                    if ((fallingBlock is object) && fallingBlock.IsAt(r, c))
                    {
                        curr_board[r, c] = fallingBlock.CellAt(r, c);
                    }
                    else
                    {
                        curr_board[r, c] = board[r, c];
                    }
                }
            }

            return(StringToMatrix.Inverse(curr_board, Rows(), Columns()));
        }
Example #10
0
 public override String ToString()
 {
     return(StringToMatrix.Inverse(blocks, rows, cols));
 }
Example #11
0
 public override string ToString()
 {
     return(StringToMatrix.Inverse(this.blocks, this.Rows(), this.Columns()));
 }
Example #12
0
 public override string ToString()
 {
     return(StringToMatrix.Inverse(blocks, Rows(), Columns()));
 }