Exemplo n.º 1
0
        public static GfxObjDegradeInfo ReadFromDat(uint fileId)
        {
            // Check the FileCache so we don't need to hit the FileSystem repeatedly
            if (DatManager.PortalDat.FileCache.ContainsKey(fileId))
            {
                return((GfxObjDegradeInfo)DatManager.PortalDat.FileCache[fileId]);
            }
            else
            {
                DatReader         datReader = DatManager.PortalDat.GetReaderForFile(fileId);
                GfxObjDegradeInfo obj       = new GfxObjDegradeInfo();

                obj.Id = datReader.ReadUInt32();

                uint num_degrades = datReader.ReadUInt32();
                for (uint i = 0; i < num_degrades; i++)
                {
                    obj.Degrades.Add(GfxObjInfo.Read(datReader));
                }

                // Store this object in the FileCache
                DatManager.PortalDat.FileCache[fileId] = obj;

                return(obj);
            }
        }
Exemplo n.º 2
0
        public TreeNode BuildTree()
        {
            var treeView = new TreeNode($"{_degrade.Id:X8}");

            foreach (var degrade in _degrade.Degrades)
            {
                var degradeTree = new GfxObjInfo(degrade).BuildTree();
                var degradeNode = new TreeNode($"{degradeTree[0].Name.Replace("ID: ", "")}");
                degradeTree.RemoveAt(0);
                degradeNode.Items.AddRange(degradeTree);
                treeView.Items.Add(degradeNode);
            }
            return(treeView);
        }