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

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

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

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

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

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

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

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