Esempio n. 1
0
        public void Read(SerializedReader reader)
        {
            if (TypeTreeNode.IsFormat5(reader.Generation))
            {
                int nodesCount       = reader.ReadInt32();
                int customBufferSize = reader.ReadInt32();
                Nodes = new TypeTreeNode[nodesCount];
                for (int i = 0; i < nodesCount; i++)
                {
                    TypeTreeNode node = new TypeTreeNode();
                    node.Read(reader);
                    Nodes[i] = node;
                }
                CustomTypeBuffer = new byte[customBufferSize];
                reader.Read(CustomTypeBuffer, 0, CustomTypeBuffer.Length);

                if (HasUnknown(reader.Generation))
                {
                    Unknown = reader.ReadInt32();
                }
            }
            else
            {
                List <TypeTreeNode> nodes = new List <TypeTreeNode>();
                ReadTreeNode(reader, nodes, 0);
                Nodes = nodes.ToArray();
            }
        }