Ejemplo n.º 1
0
 public void RemoveChild(TypeTree typeTree)
 {
     if (childs.Contains(typeTree)) {
         typeTree.parent = null;
         childs.Remove(typeTree);
     }
 }
Ejemplo n.º 2
0
 private void extractOnlyRawText(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
 {
     if (typeTree != null) {
         SerializeObject sobj = new SerializeObject(typeTree, objinfo.data);
         ExtractRawText(sobj,outputPath);
     }
 }
Ejemplo n.º 3
0
 public void AddChild(TypeTree typeTree)
 {
     if (!childs.Contains(typeTree)) {
         typeTree.parent = this;
         childs.Add(typeTree);
     }
 }
Ejemplo n.º 4
0
 public void AddChild(TypeTree typeTree)
 {
     if (!childs.Contains(typeTree))
     {
         typeTree.parent = this;
         childs.Add(typeTree);
     }
 }
Ejemplo n.º 5
0
 private void extractOnlyRawText(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
 {
     if (typeTree != null)
     {
         SerializeObject sobj = new SerializeObject(typeTree, objinfo.data);
         ExtractRawText(sobj, outputPath);
     }
 }
Ejemplo n.º 6
0
 public void RemoveChild(TypeTree typeTree)
 {
     if (childs.Contains(typeTree))
     {
         typeTree.parent = null;
         childs.Remove(typeTree);
     }
 }
Ejemplo n.º 7
0
 public SerializeObject(TypeTree type, byte[] rawData)
 {
     RootProperty = new SerializeProperty(type);
     MemoryStream ms = new MemoryStream(rawData);
     DataReader br = new DataReader(ms);
     RootProperty.DeSerialize(br);
     br.Close();
     ms.Close();
 }
Ejemplo n.º 8
0
 public void Put(int version,int classID,TypeTree type)
 {
     Dictionary<int, TypeTree> dic;
     if (!mTypeDic.TryGetValue(version, out dic)) {
         dic = new Dictionary<int, TypeTree>();
         mTypeDic[version] = dic;
     }
     dic[classID] = type;
 }
Ejemplo n.º 9
0
        private void extractRawTextOrRawBits(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
        {
            if (typeTree != null) {
                extractOnlyRawText(objinfo, typeTree, outputPath);
            } else {
                extractOnlyRawBits(objinfo,typeTree,outputPath);
            }

        }
Ejemplo n.º 10
0
        public SerializeObject(TypeTree type, byte[] rawData)
        {
            RootProperty = new SerializeProperty(type);
            MemoryStream ms = new MemoryStream(rawData);
            DataReader   br = new DataReader(ms);

            RootProperty.DeSerialize(br);
            br.Close();
            ms.Close();
        }
Ejemplo n.º 11
0
        public void Put(int version, int classID, TypeTree type)
        {
            Dictionary <int, TypeTree> dic;

            if (!mTypeDic.TryGetValue(version, out dic))
            {
                dic = new Dictionary <int, TypeTree>();
                mTypeDic[version] = dic;
            }
            dic[classID] = type;
        }
Ejemplo n.º 12
0
 private void extractRawTextOrRawBits(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
 {
     if (typeTree != null)
     {
         extractOnlyRawText(objinfo, typeTree, outputPath);
     }
     else
     {
         extractOnlyRawBits(objinfo, typeTree, outputPath);
     }
 }
Ejemplo n.º 13
0
        static private TypeTree GenerateTypeTreeV9(SerializeAssetV09.SerializeTypeTreeData tree)
        {
            TypeTree root = new TypeTree();

            root.name     = tree.name;
            root.type     = tree.type;
            root.metaFlag = tree.metaFlag;
            foreach (var childType in tree.children)
            {
                var childTree = GenerateTypeTreeV9(childType);
                root.AddChild(childTree);
            }
            return(root);
        }
Ejemplo n.º 14
0
 private void ExtractAuto(Asset.AssetObjectInfo objinfo,TypeTree typeTree, string outputPath)
 {
     if (typeTree != null) {
         SerializeObject sobj = new SerializeObject(typeTree, objinfo.data);
         ISerializeObjectExtrator extrator;
         if (mObjectExtratorDic.TryGetValue(typeTree.type, out extrator)) {
             extrator.Extract(sobj, outputPath);
         } else {
             extractOnlyRawText(objinfo, typeTree, outputPath);
         }
     } else {
         extractOnlyRawBits(objinfo, typeTree, outputPath);
     }
 }
Ejemplo n.º 15
0
 public void ExtractObjct(Asset.AssetObjectInfo obj, TypeTree typeTree, string outputPath, ExtractMode mode = ExtractMode.Auto)
 {
     outputPath = outputPath + "\\" + AssetToolUtility.ClassIDToClassName(obj.classID) + "\\";
     switch (mode) {
         case ExtractMode.Auto:
         ExtractAuto(obj, typeTree, outputPath);
         break;
         case ExtractMode.OnlyRawBits:
         extractOnlyRawBits(obj, typeTree, outputPath);
         break;
         case ExtractMode.OnlyRawText:
         extractOnlyRawText(obj, typeTree, outputPath);
         break;
         case ExtractMode.RawTextOrRawBits:
         extractRawTextOrRawBits(obj, typeTree, outputPath);
         break;
     }
 }
Ejemplo n.º 16
0
 private void extractOnlyRawBits(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
 {
     string name = "";
     if (typeTree != null && Path.GetFileName(outputPath) == "") {           
         try {
             SerializeObject sobj  = new SerializeObject(typeTree, objinfo.data);
            var nameProperty = sobj.FindProperty("m_Name");              
             if (nameProperty != null) {
                 name = nameProperty.Value as string;
                 outputPath += "/" + name;
             }
         } catch {
             Debug.LogError("Can't Create SerializeObject.TypeVerion:{0},TypeClassID:{1},TypeName:{2}",
                 typeTree.version, objinfo.classID, typeTree.type);
         }
     }
     ExtractRawBits(objinfo, outputPath);
 }
Ejemplo n.º 17
0
        public void DeSerialize(Stream stream)
        {
            if (stream.Length <= 0)
            {
                return;
            }
            BinaryReader br         = new BinaryReader(stream);
            int          numOfTypes = br.ReadInt32();

            TypeTree[] trees = new TypeTree[numOfTypes];
            Dictionary <TypeTree, int> typeVersionDic = new Dictionary <TypeTree, int>();
            Dictionary <TypeTree, int> typeClassIDDic = new Dictionary <TypeTree, int>();
            Dictionary <TypeTree, int> typeParentDic  = new Dictionary <TypeTree, int>();

            for (int i = 0; i < numOfTypes; i++)
            {
                trees[i] = new TypeTree();
                typeVersionDic[trees[i]] = br.ReadInt32();
                typeClassIDDic[trees[i]] = br.ReadInt32();
                typeParentDic[trees[i]]  = br.ReadInt32();
                trees[i].type            = br.ReadString();
                trees[i].name            = br.ReadString();
                trees[i].metaFlag        = br.ReadInt32();
            }

            for (int i = 0; i < numOfTypes; i++)
            {
                int version     = typeVersionDic[trees[i]];
                int classID     = typeClassIDDic[trees[i]];
                int parentIndex = typeParentDic[trees[i]];
                if (parentIndex == -1)
                {
                    Put(version, classID, trees[i]);
                }
                else
                {
                    var parent = trees[parentIndex];
                    parent.AddChild(trees[i]);
                }
            }

            regiserDefaultTypetyess();
        }
Ejemplo n.º 18
0
 private void ExtractAuto(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
 {
     if (typeTree != null)
     {
         SerializeObject          sobj = new SerializeObject(typeTree, objinfo.data);
         ISerializeObjectExtrator extrator;
         if (mObjectExtratorDic.TryGetValue(typeTree.type, out extrator))
         {
             extrator.Extract(sobj, outputPath);
         }
         else
         {
             extractOnlyRawText(objinfo, typeTree, outputPath);
         }
     }
     else
     {
         extractOnlyRawBits(objinfo, typeTree, outputPath);
     }
 }
Ejemplo n.º 19
0
        private void extractOnlyRawBits(Asset.AssetObjectInfo objinfo, TypeTree typeTree, string outputPath)
        {
            string name = "";

            if (typeTree != null && Path.GetFileName(outputPath) == "")
            {
                try {
                    SerializeObject sobj         = new SerializeObject(typeTree, objinfo.data);
                    var             nameProperty = sobj.FindProperty("m_Name");
                    if (nameProperty != null)
                    {
                        name        = nameProperty.Value as string;
                        outputPath += "/" + name;
                    }
                } catch {
                    Debug.LogError("Can't Create SerializeObject.TypeVerion:{0},TypeClassID:{1},TypeName:{2}",
                                   typeTree.version, objinfo.classID, typeTree.type);
                }
            }
            ExtractRawBits(objinfo, outputPath);
        }
Ejemplo n.º 20
0
        public void ExtractObjct(Asset.AssetObjectInfo obj, TypeTree typeTree, string outputPath, ExtractMode mode = ExtractMode.Auto)
        {
            outputPath = outputPath + "\\" + AssetToolUtility.ClassIDToClassName(obj.classID) + "\\";
            switch (mode)
            {
            case ExtractMode.Auto:
                ExtractAuto(obj, typeTree, outputPath);
                break;

            case ExtractMode.OnlyRawBits:
                extractOnlyRawBits(obj, typeTree, outputPath);
                break;

            case ExtractMode.OnlyRawText:
                extractOnlyRawText(obj, typeTree, outputPath);
                break;

            case ExtractMode.RawTextOrRawBits:
                extractRawTextOrRawBits(obj, typeTree, outputPath);
                break;
            }
        }
Ejemplo n.º 21
0
 static private TypeTree GenerateTypeTreeV9(SerializeAssetV09.SerializeTypeTreeData tree)
 {
     TypeTree root = new TypeTree();
     root.name = tree.name;
     root.type = tree.type;
     root.metaFlag = tree.metaFlag;
     foreach (var childType in tree.children) {
         var childTree = GenerateTypeTreeV9(childType);
         root.AddChild(childTree);
     }
     return root;
 }
Ejemplo n.º 22
0
        public void DeSerialize(Stream stream)
        {
            if (stream.Length <= 0) return;
            BinaryReader br = new BinaryReader(stream);
            int numOfTypes = br.ReadInt32();
            TypeTree[] trees = new TypeTree[numOfTypes];
            Dictionary<TypeTree, int> typeVersionDic = new Dictionary<TypeTree, int>();
            Dictionary<TypeTree, int> typeClassIDDic = new Dictionary<TypeTree, int>();
            Dictionary<TypeTree, int> typeParentDic = new Dictionary<TypeTree, int>();
            for (int i = 0; i < numOfTypes; i++) {
                trees[i] = new TypeTree();
                typeVersionDic[trees[i]] = br.ReadInt32();
                typeClassIDDic[trees[i]] = br.ReadInt32();
                typeParentDic[trees[i]] = br.ReadInt32();
                trees[i].type = br.ReadString();
                trees[i].name = br.ReadString();
                trees[i].metaFlag = br.ReadInt32();
            }

            for (int i = 0; i < numOfTypes; i++) {
                int version = typeVersionDic[trees[i]];
                int classID = typeClassIDDic[trees[i]];
                int parentIndex = typeParentDic[trees[i]];
                if (parentIndex == -1) {
                    Put(version, classID, trees[i]);
                } else {
                    var parent = trees[parentIndex];
                    parent.AddChild(trees[i]);
                }
            }

            regiserDefaultTypetyess();
        }
Ejemplo n.º 23
0
 public SerializeObject(TypeTree type, DataReader data)
 {
     RootProperty = new SerializeProperty(type);
     RootProperty.DeSerialize(data);
 }
Ejemplo n.º 24
0
 public SerializeObject(TypeTree type, DataReader data)
 {
     RootProperty = new SerializeProperty(type);
     RootProperty.DeSerialize(data);
 }
Ejemplo n.º 25
0
        private object readValue(SerializePropertyType ptype,TypeTree typeTree, DataReader data)
        {
            
            object ret = null;
            switch (ptype) {
                case SerializePropertyType.Bool:
                ret = data.ReadBool();
                break;
                case SerializePropertyType.SByte:
                ret = data.ReadSbyte();
                break;
                case SerializePropertyType.Byte:
                ret = data.ReadByte();
                break;
                case SerializePropertyType.Short:
                ret = data.ReadInt16();
                break;
                case SerializePropertyType.UShort:
                ret = data.ReadUInt16();
                break;
                case SerializePropertyType.Int:
                ret = data.ReadInt32();
                break;
                case SerializePropertyType.UInt:
                ret = data.ReadUint32();
                break;
                case SerializePropertyType.Long:
                ret = data.ReadInt64();
                break;
                case SerializePropertyType.ULong:
                ret = data.ReadUInt64();
                break;
                case SerializePropertyType.Float:
                ret = data.ReadFloat();
                break;
                case SerializePropertyType.Double:
                ret = data.ReadDouble();
                break;
                case SerializePropertyType.String:
                int strSize = data.ReadInt32();
                ret = UnicodeEncoding.UTF8.GetString(data.ReadBytes(strSize));
                //ret = UTF8Encoding.Default.GetString();
                break;
                default:
                break;
            }

            if (((typeTree.metaFlag & TypeTree.FLAG_FORCE_ALIGN) != 0)  || propertyType == SerializePropertyType.String) {
                data.Align(4);
            }

            return ret;
        }
Ejemplo n.º 26
0
        public object readArrayValue(TypeTree typeTree, DataReader data)
        {
            var elementType = typeTree.GetChildren()[1];

            arrayLength      = data.ReadInt32();
            arrayElementType = typeStr2PropertyType(elementType.type);
            object ret = null;

            switch (arrayElementType)
            {
            case SerializePropertyType.Bool:
                ret = data.ReadBool(arrayLength);
                break;

            case SerializePropertyType.Byte:
                ret = data.ReadBytes(arrayLength);
                break;

            case SerializePropertyType.Double:
                ret = data.ReadDouble(arrayLength);
                break;

            case SerializePropertyType.Float:
                ret = data.ReadFloat(arrayLength);
                break;

            case SerializePropertyType.Int:
                ret = data.ReadInt32(arrayLength);
                break;

            case SerializePropertyType.Long:
                ret = data.ReadInt64(arrayLength);
                break;

            case SerializePropertyType.SByte:
                ret = data.ReadSbytes(arrayLength);
                break;

            case SerializePropertyType.Short:
                ret = data.ReadInt16(arrayLength);
                break;

            case SerializePropertyType.String:
                string[] stringArray = new string[arrayLength];
                for (int i = 0; i < arrayLength; i++)
                {
                    int strSize = data.ReadInt32();
                    stringArray[i] = UnicodeEncoding.UTF8.GetString(data.ReadBytes(strSize));
                    data.Align(4);
                }
                ret = stringArray;
                break;

            case SerializePropertyType.UInt:
                ret = data.ReadUint32(arrayLength);
                break;

            case SerializePropertyType.ULong:
                ret = data.ReadUInt64(arrayLength);
                break;

            case SerializePropertyType.UShort:
                ret = data.ReadUInt16(arrayLength);
                break;

            default:
                SerializeProperty[] properArray = new SerializeProperty[arrayLength];
                for (int i = 0; i < arrayLength; i++)
                {
                    SerializeProperty value = null;
                    if (arrayElementType == SerializePropertyType.Property || arrayElementType == SerializePropertyType.Array)
                    {
                        var sp = new SerializeProperty(elementType);
                        sp.DeSerialize(data);
                        value = sp;
                    }
                    properArray[i] = value;
                }
                ret = properArray;
                break;
            }

            data.Align(4);
            return(ret);
        }
Ejemplo n.º 27
0
        static public TypeTreeDataBase GenerateTypeTreeDataBase(SerializeAssetV15 asset)
        {
            TypeTreeDataBase         DB            = new TypeTreeDataBase();
            Dictionary <int, string> typeNameTable = new Dictionary <int, string>();
            //一个共享的类型字符串表
            string defaultTypeStr = Properties.Resources.ResourceManager.GetString("TypeStringTableV15");
            var    typeStrArray   = defaultTypeStr.Split('\n');
            int    startOffset    = 1 << 31;

            for (int i = 0; i < typeStrArray.Length; i++)
            {
                typeNameTable[startOffset] = typeStrArray[i].Substring(0, typeStrArray[i].Length - 1);
                startOffset += typeStrArray[i].Length;
            }

            foreach (var baseClass in asset.classes)
            {
                if (baseClass.stringTable == null)
                {
                    continue;
                }
                Dictionary <int, string> onwerStrTable = new Dictionary <int, string>();
                MemoryStream             ms            = new MemoryStream(baseClass.stringTable);
                DataReader data     = new DataReader(ms);
                TypeTree   rootType = new TypeTree();
                TypeTree   nodePrev = null;

                Dictionary <TypeTree, int> typeLevelDic = new Dictionary <TypeTree, int>();
                foreach (var field in baseClass.types)
                {
                    string name = "";
                    string type = "";
                    if (field.nameOffset < 0)
                    {
                        if (typeNameTable.ContainsKey(field.nameOffset))
                        {
                            name = typeNameTable[field.nameOffset];
                        }
                    }
                    else
                    {
                        data.position = field.nameOffset;
                        name          = data.ReadStringNull();
                    }

                    if (field.typeOffset < 0)
                    {
                        if (typeNameTable.ContainsKey(field.typeOffset))
                        {
                            type = typeNameTable[field.typeOffset];
                        }
                    }
                    else
                    {
                        data.position = field.typeOffset;
                        type          = data.ReadStringNull();
                    }

                    if (nodePrev == null)
                    {
                        rootType.name          = name;
                        rootType.type          = type;
                        rootType.metaFlag      = field.metaFlag;
                        nodePrev               = rootType;
                        typeLevelDic[nodePrev] = field.treeLevel;
                        continue;
                    }
                    TypeTree nodeCurr = new TypeTree();
                    nodeCurr.name          = name;
                    nodeCurr.type          = type;
                    nodeCurr.metaFlag      = field.metaFlag;
                    typeLevelDic[nodeCurr] = field.treeLevel;
                    int levels = typeLevelDic[nodePrev] - field.treeLevel;
                    if (levels >= 0)
                    {
                        for (int i = 0; i < levels; i++)
                        {
                            nodePrev = nodePrev.parent;
                        }
                        nodePrev.parent.AddChild(nodeCurr);
                    }
                    else
                    {
                        nodePrev.AddChild(nodeCurr);
                    }
                    nodePrev = nodeCurr;
                }
                DB.Put(15, baseClass.ClassID, rootType);
                Console.Write(rootType);
                data.Close();
                ms.Close();
            }
            return(DB);
        }
Ejemplo n.º 28
0
        public object readArrayValue(TypeTree typeTree, DataReader data)
        {            
            var elementType = typeTree.GetChildren()[1];
            arrayLength = data.ReadInt32();
            arrayElementType = typeStr2PropertyType(elementType.type);
            object ret = null;
            switch (arrayElementType) {
                case SerializePropertyType.Bool:
                ret = data.ReadBool(arrayLength);
                break;
                case SerializePropertyType.Byte:
                ret = data.ReadBytes(arrayLength);
                break;
                case SerializePropertyType.Double:
                ret = data.ReadDouble(arrayLength);
                break;
                case SerializePropertyType.Float:
                ret = data.ReadFloat(arrayLength);
                break;
                case SerializePropertyType.Int:
                ret = data.ReadInt32(arrayLength);
                break;
                case SerializePropertyType.Long:
                ret = data.ReadInt64(arrayLength);
                break;
                case SerializePropertyType.SByte:
                ret = data.ReadSbytes(arrayLength);
                break;
                case SerializePropertyType.Short:
                ret = data.ReadInt16(arrayLength);
                break;
                case SerializePropertyType.String:
                string[] stringArray = new string[arrayLength];
                for (int i = 0; i < arrayLength; i++) {
                    int strSize = data.ReadInt32();
                    stringArray[i] = UnicodeEncoding.UTF8.GetString(data.ReadBytes(strSize));
                    data.Align(4);
                }
                ret = stringArray;
                break;
                case SerializePropertyType.UInt:
                ret = data.ReadUint32(arrayLength);
                break;
                case SerializePropertyType.ULong:
                ret = data.ReadUInt64(arrayLength);
                break;
                case SerializePropertyType.UShort:
                ret = data.ReadUInt16(arrayLength);
                break;
                default:
                SerializeProperty[] properArray = new SerializeProperty[arrayLength];
                for (int i = 0; i < arrayLength; i++) {
                    SerializeProperty value = null;
                    if (arrayElementType == SerializePropertyType.Property || arrayElementType == SerializePropertyType.Array) {
                        var sp = new SerializeProperty(elementType);
                        sp.DeSerialize(data);
                        value = sp;
                    }
                    properArray[i] = value;
                }
                ret = properArray;
                break;
            }

            data.Align(4);
            return ret;
        }
Ejemplo n.º 29
0
        private object readValue(SerializePropertyType ptype, TypeTree typeTree, DataReader data)
        {
            object ret = null;

            switch (ptype)
            {
            case SerializePropertyType.Bool:
                ret = data.ReadBool();
                break;

            case SerializePropertyType.SByte:
                ret = data.ReadSbyte();
                break;

            case SerializePropertyType.Byte:
                ret = data.ReadByte();
                break;

            case SerializePropertyType.Short:
                ret = data.ReadInt16();
                break;

            case SerializePropertyType.UShort:
                ret = data.ReadUInt16();
                break;

            case SerializePropertyType.Int:
                ret = data.ReadInt32();
                break;

            case SerializePropertyType.UInt:
                ret = data.ReadUint32();
                break;

            case SerializePropertyType.Long:
                ret = data.ReadInt64();
                break;

            case SerializePropertyType.ULong:
                ret = data.ReadUInt64();
                break;

            case SerializePropertyType.Float:
                ret = data.ReadFloat();
                break;

            case SerializePropertyType.Double:
                ret = data.ReadDouble();
                break;

            case SerializePropertyType.String:
                int strSize = data.ReadInt32();
                ret = UnicodeEncoding.UTF8.GetString(data.ReadBytes(strSize));
                //ret = UTF8Encoding.Default.GetString();
                break;

            default:
                break;
            }

            if (((typeTree.metaFlag & TypeTree.FLAG_FORCE_ALIGN) != 0) || propertyType == SerializePropertyType.String)
            {
                data.Align(4);
            }

            return(ret);
        }
Ejemplo n.º 30
0
 public SerializeProperty(TypeTree type)
 {
     mType = type;
 }
Ejemplo n.º 31
0
 public SerializeProperty(TypeTree type)
 {
     mType = type;
 }
Ejemplo n.º 32
0
        static public TypeTreeDataBase GenerateTypeTreeDataBase(SerializeAssetV15 asset)
        {

            TypeTreeDataBase DB = new TypeTreeDataBase();
            Dictionary<int, string> typeNameTable = new Dictionary<int, string>();
            //一个共享的类型字符串表
            string defaultTypeStr = Properties.Resources.ResourceManager.GetString("TypeStringTableV15");
            var typeStrArray = defaultTypeStr.Split('\n');
            int startOffset = 1 << 31;
            for (int i = 0; i < typeStrArray.Length; i++) {
                typeNameTable[startOffset] = typeStrArray[i].Substring(0, typeStrArray[i].Length-1);
                startOffset += typeStrArray[i].Length;
            }

            foreach (var baseClass in asset.classes) {
                if (baseClass.stringTable == null) continue;
                Dictionary<int, string> onwerStrTable = new Dictionary<int, string>();
                MemoryStream ms = new MemoryStream(baseClass.stringTable);
                DataReader data = new DataReader(ms);
                TypeTree rootType = new TypeTree();
                TypeTree nodePrev = null;
                
                Dictionary<TypeTree, int> typeLevelDic = new Dictionary<TypeTree, int>();
                foreach (var field in baseClass.types) {
                    string name = "";
                    string type = "";
                    if (field.nameOffset < 0) {
                        if (typeNameTable.ContainsKey(field.nameOffset)) {
                            name = typeNameTable[field.nameOffset];
                        }
                    } else {
                        data.position = field.nameOffset;
                        name = data.ReadStringNull();
                    }

                    if (field.typeOffset < 0) {
                        if (typeNameTable.ContainsKey(field.typeOffset)) {
                            type = typeNameTable[field.typeOffset];
                        }
                    } else {
                        data.position = field.typeOffset;
                        type = data.ReadStringNull();
                    }

                    if (nodePrev == null) {
                        rootType.name = name;
                        rootType.type = type;
                        rootType.metaFlag = field.metaFlag;
                        nodePrev = rootType;
                        typeLevelDic[nodePrev] = field.treeLevel;
                        continue;
                    }
                    TypeTree nodeCurr = new TypeTree();
                    nodeCurr.name = name;
                    nodeCurr.type = type;
                    nodeCurr.metaFlag = field.metaFlag;
                    typeLevelDic[nodeCurr] = field.treeLevel;
                    int levels = typeLevelDic[nodePrev] - field.treeLevel;
                    if (levels >= 0) {
                        for (int i = 0; i < levels; i++) {
                            nodePrev = nodePrev.parent;
                        }
                        nodePrev.parent.AddChild(nodeCurr);
                    } else {
                        nodePrev.AddChild(nodeCurr);
                    }
                    nodePrev = nodeCurr;
                }
                DB.Put(15, baseClass.ClassID, rootType);
                Console.Write(rootType);
                data.Close();
                ms.Close();
            }
            return DB;
        }