예제 #1
0
 /// <summary>
 /// Parse an SGFCollection object from a TextReader.
 /// </summary>
 /// <param name="sr">The source TextReader.</param>
 public void Read(TextReader sr)
 {
     sr.EatWS();
     while ((char)sr.Peek() == '(')
     {
         var gameTree = new SGFGameTree();
         gameTree.Read(sr);
         GameTrees.Add(gameTree);
         sr.EatWS();
     }
 }
예제 #2
0
 /// <summary>
 /// Parse an SGFCollection object from a TextReader.
 /// </summary>
 /// <param name="sr">The source TextReader.</param>
 public void Read(TextReader sr)
 {
     sr.EatWS();
     while ((char)sr.Peek() == '(')
     {
         var gameTree = new SGFGameTree();
         gameTree.Read(sr);
         GameTrees.Add(gameTree);
         sr.EatWS();
     }
 }
예제 #3
0
 internal void Read(TextReader sr)
 {
     char c = (char)sr.Read();
     if (c != '(')
         throw new InvalidDataException("Game-tree doesn't begin with a '('.");
     Sequence.Read(sr);
     sr.EatWS();
     while ((char)sr.Peek() == '(')
     {
         SGFGameTree gameTree = new SGFGameTree();
         gameTree.Read(sr);
         GameTrees.Add(gameTree);
         sr.EatWS();
     }
     c = (char)sr.Read();
     if (c != ')')
         throw new InvalidDataException("Game-tree doesn't end with a ')'.");
 }
예제 #4
0
파일: SGFGameTree.cs 프로젝트: serd/GoSharp
        internal void Read(TextReader sr)
        {
            char c = (char)sr.Read();

            if (c != '(')
            {
                throw new InvalidDataException("Game-tree doesn't begin with a '('.");
            }
            Sequence.Read(sr);
            sr.EatWS();
            while ((char)sr.Peek() == '(')
            {
                SGFGameTree gameTree = new SGFGameTree();
                gameTree.Read(sr);
                GameTrees.Add(gameTree);
                sr.EatWS();
            }
            c = (char)sr.Read();
            if (c != ')')
            {
                throw new InvalidDataException("Game-tree doesn't end with a ')'.");
            }
        }