当前位置: 首页>>代码示例>>C#>>正文


C# Iterator.next方法代码示例

本文整理汇总了C#中Iterator.next方法的典型用法代码示例。如果您正苦于以下问题:C# Iterator.next方法的具体用法?C# Iterator.next怎么用?C# Iterator.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Iterator的用法示例。


在下文中一共展示了Iterator.next方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: add_to_player_iterator

 private void add_to_player_iterator(Iterator iterator,BrandPlayer player)
 {
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         player.add(brand);
     }
 }
开发者ID:billteng,项目名称:mahjong,代码行数:8,代码来源:DealTest.cs

示例2: print

 private void print(Iterator iterator)
 {
     //Console.WriteLine();
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         Console.Write("{0}{1}\t", brand.getNumber(), brand.getClass() );
     }
 }
开发者ID:billteng,项目名称:mahjong,代码行数:9,代码来源:AiTest.cs

示例3: getBrands

 private void getBrands(Iterator iterator)
 {
     while (iterator.hasNext())
     {
         Brand brandtemp = (Brand)iterator.next();
         for (int i=0; i < tempPlayers.Length ; i++ )
             if (brandtemp.getClass()==BrandClass[i].getClass())
                 tempPlayers[i].add(brandtemp);
         if (brandtemp.Team > 0)
             teamBrands.add(brandtemp);
     }
 }
开发者ID:billteng,项目名称:mahjong,代码行数:12,代码来源:PlayerSort.cs

示例4: print

 private void print(Iterator iterator)
 {
     Console.WriteLine();
     //TeamBrands t;
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         //if (brand.getClass==t.getClass)
         //    Console.WriteLine("==Get a TeamBrands==");
         Console.Write("{0},{1}\t", brand.getNumber(),brand.getClass());
     }
 }
开发者ID:billteng,项目名称:mahjong,代码行数:12,代码来源:BrandsTest.cs

示例5: removefromplayer

 BrandPlayer removefromplayer(Iterator iterator,BrandPlayer re)
 {
     while(iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         //re.remove(brand);
         Console.WriteLine(">>{0}",re.remove(brand));
     }
     return re;
 }
开发者ID:billteng,项目名称:mahjong,代码行数:10,代码来源:BrandsTest.cs

示例6: addimage_iterator

 /// <summary>
 /// 新增圖片反覆器
 /// </summary>
 /// <param name="iterator">玩家反覆器</param>
 /// <param name="state">目前方位</param>
 /// <param name="rotate">圖片方向</param>
 protected virtual void addimage_iterator(Iterator iterator, location state, RotateFlipType rotate)
 {
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         addimage(state, brand, rotate);
     }
 }
开发者ID:Superbil,项目名称:mahjong,代码行数:14,代码来源:Table.cs

示例7: printIterator

 public static void printIterator(Iterator iterator, String pre)
 {
     Item item = new Item();
       iterator.open();
       while (iterator.next(item)) {
       printItem(item, pre);
       }
       item.Dispose();
       iterator.close();
       iterator.Dispose();
 }
开发者ID:cezarfx,项目名称:zorba,代码行数:11,代码来源:test08.cs

示例8: Apply

        public static int Apply(ScriptContext/*!*/context, PHP.Core.Reflection.DTypeDesc caller, Iterator/*!*/iterator, PhpCallback function, PhpArray args)
        {
            // check parameters:
            Debug.Assert(context != null);
            Debug.Assert(iterator != null, "Phalanger should not pass a null here.");

            if (function == null)
            {
                PhpException.ArgumentNull("function");
                return -1;
            }

            // copy args into object array:
            object[] args_array;

            if (args != null)
            {
                args_array = new object[args.Count];
                args.Values.CopyTo(args_array, 0);
            }
            else
            {
                args_array = ArrayUtils.EmptyObjects;
            }

            // iterate through the iterator:
            int n = 0;
            
            iterator.rewind(context);
            
            while (PHP.Core.Convert.ObjectToBoolean(iterator.valid(context)))
            {
                if (!PHP.Core.Convert.ObjectToBoolean(function.Invoke(caller, args_array)))
                    break;
		        n++;

		        iterator.next(context);
	        }

            // return amount of iterated elements:
            return n;
        }
开发者ID:hansdude,项目名称:Phalanger,代码行数:42,代码来源:Iterators.cs

示例9: PhpArray

        public static PhpArray/*!*/ToArray(ScriptContext/*!*/context, Iterator/*!*/iterator, bool use_keys/*=true*/)
        {
            // check parameters:
            Debug.Assert(context != null);
            Debug.Assert(iterator != null, "Phalanger should not pass a null here.");

            //
            var array = new PhpArray();

            // iterate through the iterator:
            iterator.rewind(context);

            while (PHP.Core.Convert.ObjectToBoolean(iterator.valid(context)))
            {
                object value = iterator.current(context);   // PHP calls current() first
                if (use_keys)
                    array[iterator.key(context)] = value;
                else
                    array.Add(value);

                iterator.next(context);
            }

            // return amount of iterated elements:
            return array;
        }
开发者ID:hansdude,项目名称:Phalanger,代码行数:26,代码来源:Iterators.cs

示例10: Count

        public static int Count(ScriptContext/*!*/context, Iterator/*!*/iterator)
        {
            // check parameters:
            Debug.Assert(context != null);
            Debug.Assert(iterator != null, "Phalanger should not pass a null here.");
            
            // iterate through the iterator:
            int n = 0;

            iterator.rewind(context);

            while (PHP.Core.Convert.ObjectToBoolean(iterator.valid(context)))
            {
                n++;
                iterator.next(context);
            }

            // return amount of iterated elements:
            return n;
        }
开发者ID:hansdude,项目名称:Phalanger,代码行数:20,代码来源:Iterators.cs

示例11: License

 public void License(SourceDetails details, Iterator<String> lines, StringWriter writer, String line) {
    Pattern comment = Pattern.compile("^(\\s*)\\*.*$");
    writer.append(line.replaceAll("\\/\\*", "//"));
    writer.append("\n");
    while(lines.hasNext()) {
       String nextLine = lines.next();
       nextLine = nextLine.substring(1);
       if(nextLine.matches("^\\s*\\*\\/")) {
          writer.append(nextLine.replaceAll("\\*\\/", "//"));
          writer.append("\n");
          return;
       }
       Matcher matcher = comment.matcher(nextLine);
       if(matcher.matches()) {
          if(nextLine.matches(".*\\.java.*")) {
             nextLine = nextLine.replaceAll("\\.java", ".cs");
          }
          writer.append(matcher.group(1));
          writer.append(nextLine.replaceAll("^\\s*\\*", "//"));
          writer.append("\n");
       }else {
          throw new IllegalStateException("Comment does not end well '" + nextLine+"' in file "+details.Source.getCanonicalPath());
       }
    }
 }
开发者ID:ngallagher,项目名称:simplexml,代码行数:25,代码来源:LanguageConverter.cs

示例12: Comment

 public void Comment(Iterator<String> lines, StringWriter writer, String line) {
    Pattern normalComment = Pattern.compile("^(\\s*)\\*.*$");
    Pattern parameterComment = Pattern.compile("^(\\s*)\\*.*@.*$");
    bool endSummary = false;
    writer.append(line.replaceAll("\\/\\*\\*", "/// <summary>"));
    writer.append("\n");
    while(lines.hasNext()) {
       String nextLine = lines.next();
       nextLine = nextLine.substring(1);
       if(nextLine.matches("^\\s*\\*\\/")) {
          if(!endSummary) {
             writer.append(nextLine.replaceAll("\\*\\/", "/// </summary>"));
          } else {
             writer.append(nextLine.replaceAll("\\*\\/", "///"));
          }
          writer.append("\n");
          return;
       }
       if(!endSummary) {
          Matcher parameterMatch = parameterComment.matcher(nextLine);
          if(parameterMatch.matches()) {
             writer.append(parameterMatch.group(1));
             writer.append("/// </summary>");
             writer.append("\n");
             writer.append(parameterMatch.group(1));
             writer.append(nextLine.replaceAll("^\\s*\\*", "///"));
             writer.append("\n");
             endSummary = true;
          } else {
             Matcher normalMatch = normalComment.matcher(nextLine);
             if(normalMatch.matches()) {
                writer.append(normalMatch.group(1));
                writer.append(nextLine.replaceAll("^\\s*\\*", "///"));
                writer.append("\n");
             }
          }
       } else {
          Matcher normalMatch = normalComment.matcher(nextLine);
          if(normalMatch.matches()) {
             writer.append(normalMatch.group(1));
             writer.append(nextLine.replaceAll("^\\s*\\*", "///"));
             writer.append("\n");
          }else {
             throw new IllegalStateException("Comment does not end well " + nextLine);
          }
       }
    }
 }
开发者ID:ngallagher,项目名称:simplexml,代码行数:48,代码来源:LanguageConverter.cs

示例13: printplayer

 private void printplayer(Iterator iterator)
 {
     Console.WriteLine();
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         Console.Write("{0}{1}({2})\t", brand.getNumber(), brand.getClass(), brand.Source);
     }
     Console.WriteLine();
 }
开发者ID:billteng,项目名称:mahjong,代码行数:10,代码来源:Level+1.cs

示例14: removefromtable

 /// <summary>
 /// �q�ୱ�W����
 /// </summary>
 /// <param name="iterator">�ୱ���о�</param>
 /// <param name="re">�ୱ���a</param>
 /// <returns>�����᪺�ୱ���a</returns>
 BrandPlayer removefromtable(Iterator iterator, BrandPlayer re)
 {
     while (iterator.hasNext())
     {
         Brand brand = (Brand)iterator.next();
         //��P�q���a������
         re.remove(brand);
         //Console.WriteLine(">>{0}", re.remove(brand));
     }
     return re;
 }
开发者ID:billteng,项目名称:mahjong,代码行数:17,代码来源:Deal.cs


注:本文中的Iterator.next方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。