Ejemplo n.º 1
0
        public bool IsHorizontalSequenceCompletedOfSameShapeByRow(int rowIndex, Cell.TypeShape typeShape)
        {
            for (int columnIndex = 0; columnIndex < ColumnsLength; columnIndex++)
            {
                var cell = GetCellByPosition(rowIndex, columnIndex);

                if (!cell.IsValidMarked(typeShape))
                    return false;
            }

            return true;
        }
Ejemplo n.º 2
0
        public bool IsDiagonalSequenceCompletedOfSameShapeByDirection(DiagonalDirection diagonalDirection, Cell.TypeShape typeShape)
        {
            var columnIndex = (diagonalDirection == DiagonalDirection.LeftTopToRightBottom)
                                ? 0
                                : (ColumnsLength - 1);

            for (int rowIndex = 0; rowIndex < RowsLength; rowIndex++)
            {
                var cell = GetCellByPosition(rowIndex, columnIndex);

                if (!cell.IsValidMarked(typeShape))
                    return false;

                columnIndex = GetNextColumnDiagonalIndex(diagonalDirection, columnIndex);
            }

            return true;
        }
Ejemplo n.º 3
0
 public void MarkCellByPosition(int rowIndex, int columnIndex, Cell.TypeShape typeShape)
 {
     GetCellByPosition(rowIndex, columnIndex).Mark(typeShape);
 }
Ejemplo n.º 4
0
        private void InitializeEachCell()
        {
            Cells = new Cell[RowsLength, ColumnsLength];

            for (int rowIndex = 0; rowIndex < RowsLength; rowIndex++)
            {
                for (int columnIndex = 0; columnIndex < ColumnsLength; columnIndex++)
                {
                    Cells[rowIndex, columnIndex] = new Cell();
                }
            }
        }
Ejemplo n.º 5
0
 public bool IsValidMarked(Cell.TypeShape typeShape)
 {
     return IsMarked() && (MarkedBy == typeShape);
 }