Example #1
0
        public override string GetLineForQuestion(CrosswordQuestion question)
        {
            int rowIndex = Array.IndexOf(_horizontalQuestions, question);
            if (rowIndex != -1)
            {
                return MatrixHelper.GetHorizontalLine(_field, rowIndex);
            }

            int columnIndex = Array.IndexOf(_verticalQuestions, question);
            if (columnIndex != -1)
            {
                return MatrixHelper.GetVerticalLine(_field, columnIndex);
            }

            return null;
        }
Example #2
0
        public override IReadOnlyCollection<CrosswordCell> GetCellsForQuestion(CrosswordQuestion question)
        {
            var cells = new List<CrosswordCell>();
            int rowIndex = Array.IndexOf(_horizontalQuestions, question);
            if (rowIndex != -1)
            {
                cells.AddRange(Enumerable.Range(0, _size).Select(x => new CrosswordCell(rowIndex, x)));
            }

            int columnIndex = Array.IndexOf(_verticalQuestions, question);
            if (columnIndex != -1)
            {
                cells.AddRange(Enumerable.Range(0, _size).Select(x => new CrosswordCell(x, columnIndex)));
            }

            return cells;
        }
Example #3
0
 public abstract string GetLineForQuestion(CrosswordQuestion question);
Example #4
0
 public abstract IReadOnlyCollection<CrosswordCell> GetCellsForQuestion(CrosswordQuestion question);