Example #1
0
        private SGF_Node ProcessNode(SGF_Node parent, int branchNumber)
        {
            SGF_Node newNode = null;

            if (parent == null)
            {
                newNode = new SGF_Node_Root();
                roots_.Add(newNode as SGF_Node_Root);
            }
            else
            {
                newNode = new SGF_Node(roots_[branchNumber]);
                parent.AddNode(newNode);
            }
            while (!EOF)
            {
                char ch = PeekChar();
                if (IsControlChar(ch))
                {
                    break;
                }
                else if (IsUnusedChar(ch))
                {
                    ReadChar();
                    continue;
                }
                int indexPropertyValueStart = FindToPropertyValueStart();
                if (indexPropertyValueStart == -1)
                {
                    break;
                }
                byte[]       name       = ReadBytes(indexPropertyValueStart - index_);
                string       nameString = Encoding.ASCII.GetString(name);
                SGF_Property propertry  = new SGF_Property(nameString);
                ProcessPropertyValue(propertry);
                newNode.AddProperty(propertry);
            }
            return(newNode);
        }
Example #2
0
 public SGF_Node(SGF_Node_Root root)
 {
     rootNote_ = root;
 }