コード例 #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;
        }
コード例 #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;
        }
コード例 #3
0
ファイル: Crossword.cs プロジェクト: korzenikov/Projects
 public abstract string GetLineForQuestion(CrosswordQuestion question);
コード例 #4
0
ファイル: Crossword.cs プロジェクト: korzenikov/Projects
 public abstract IReadOnlyCollection<CrosswordCell> GetCellsForQuestion(CrosswordQuestion question);