Esempio n. 1
0
        public Piece(string shape)
        {
            StringToMatrix s2m = new StringToMatrix(shape);

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

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

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

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

            this.board   = stm.matrix;
            this.rows    = stm.rows;
            this.columns = stm.columns;
        }
Esempio n. 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;
        }
Esempio n. 7
0
        public void FromString(string blocks)
        {
            StringToMatrix sm = new StringToMatrix(blocks);

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

            board   = converter.blocks;
            Rows    = converter.rows;
            Columns = converter.columns;
        }
Esempio n. 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()));
        }
Esempio n. 10
0
 public override String ToString()
 {
     return(StringToMatrix.Inverse(blocks, rows, cols));
 }
Esempio n. 11
0
 public override string ToString()
 {
     return(StringToMatrix.Inverse(this.blocks, this.Rows(), this.Columns()));
 }
Esempio n. 12
0
 public override string ToString()
 {
     return(StringToMatrix.Inverse(blocks, Rows(), Columns()));
 }