Ejemplo n.º 1
0
        public PicrossBoard(PicrossBoard copySource)
        {
            Puzzle      = copySource.Puzzle;
            RowCount    = Puzzle.RowCount;
            ColumnCount = Puzzle.ColumnCount;

            Matrix = new PicrossCell[RowCount, ColumnCount];
            for (int rowIndex = 0; rowIndex < RowCount; rowIndex++)
            {
                for (int columnIndex = 0; columnIndex < ColumnCount; columnIndex++)
                {
                    PicrossCell otherCell = copySource.Matrix[rowIndex, columnIndex];
                    Matrix[rowIndex, columnIndex] = new PicrossCell()
                    {
                        State  = otherCell.State,
                        Row    = rowIndex,
                        Column = columnIndex
                    };
                }
            }

            Columns     = CopyColumns(copySource);
            Rows        = CopyRows(copySource);
            ActiveLines = (new[] { Columns, Rows }).SelectMany(collection => collection);
        }
Ejemplo n.º 2
0
        public PicrossBoard(PicrossPuzzle puzzle)
        {
            Puzzle = puzzle;

            RowCount    = Puzzle.RowCount;
            ColumnCount = Puzzle.ColumnCount;

            Matrix = new PicrossCell[RowCount, ColumnCount];
            for (int rowIndex = 0; rowIndex < RowCount; rowIndex++)
            {
                for (int columnIndex = 0; columnIndex < ColumnCount; columnIndex++)
                {
                    Matrix[rowIndex, columnIndex] = new PicrossCell()
                    {
                        Row    = rowIndex,
                        Column = columnIndex
                    };
                }
            }

            Columns     = GatherColumns();
            Rows        = GatherRows();
            ActiveLines = (new[] { Columns, Rows }).SelectMany(collection => collection);
        }
Ejemplo n.º 3
0
 public static PicrossBoard GetEmpty() => new PicrossBoard(PicrossPuzzle.GetEmpty());