private IReversiTurn TurnForCellOnBoard( ICellCoordinates turnCandidate, IBoardState board) { var cellNeighbours = board.GetNeighboursForCell(turnCandidate); var directions = cellNeighbours.Where(n => { return(board.IsCellTakenByInactivePlayer(n)); }); var allFlippedCells = new List <ICellCoordinates>(); foreach (ICellCoordinates singleDirection in directions) { IEnumerable <ICellCoordinates> flippedCells = this.FlippedCellsForDirectionOfTurnOnBoard( singleDirection, turnCandidate, board); if (null != flippedCells) { allFlippedCells.AddRange(flippedCells); } } bool isNoDirectionFlippedEnemyItems = (0 == allFlippedCells.Count); if (isNoDirectionFlippedEnemyItems) { return(null); } var result = new ReversiTurnPOD(); { result.Position = turnCandidate; result.PositionsOfFlippedItems = allFlippedCells; } return(result); }