예제 #1
0
        public static IEnumerable <IEnumerable <Stone> > GetAllLines(this PlayingBoard playingBoard)
        {
            if (playingBoard == null)
            {
                throw new ArgumentNullException("playingBoard");
            }

            return(playingBoard.GetColumns().Concat(playingBoard.GetRows()).Concat(playingBoard.GetDiagonals()));
        }
예제 #2
0
        public static IEnumerable <Stone> GetAllFields(this PlayingBoard playingBoard)
        {
            if (playingBoard == null)
            {
                throw new ArgumentNullException("playingBoard");
            }

            return(playingBoard.GetRows().SelectMany(r => r));
        }