示例#1
0
        private CordinateSet GetRightDiagonalCordinates()
        {
            var rowCounter        = GRID_WIDTH - 1;
            var winningCordinates = new CordinateSet();

            foreach (var set in GetRowCordinateSets())
            {
                var cords = set.Get().ToArray()[rowCounter];
                rowCounter--;
                winningCordinates.Set(cords);
            }
            return(winningCordinates);
        }
示例#2
0
        private CordinateSet GetLeftDiagonalCordinates()
        {
            var rowCounter        = 0;
            var winningCordinates = new CordinateSet();

            foreach (var set in GetRowCordinateSets())
            {
                var cords = set.Get().ToArray()[rowCounter];
                rowCounter++;
                winningCordinates.Set(cords);
            }

            return(winningCordinates);
        }
示例#3
0
        private CordinateSet GetRowCordinates(int rowNumber)
        {
            var winningCordinates = new CordinateSet();

            for (var c = 1; c <= GRID_WIDTH; c++)
            {
                var cords = new Cordinate
                {
                    X = rowNumber,
                    Y = c
                };
                winningCordinates.Set(cords);
            }

            return(winningCordinates);
        }
示例#4
0
        private CordinateSet GetColumnCordinates(int columnNumber)
        {
            var winningCordinates = new CordinateSet();

            for (var r = 1; r <= GRID_HEIGHT; r++)
            {
                var cords =
                    new Cordinate
                {
                    X = r,
                    Y = columnNumber
                };
                winningCordinates.Set(cords);
            }

            return(winningCordinates);
        }