예제 #1
0
        private void BuildFS()
        {
            RootDirectory      = new Directory();
            RootDirectory.Name = "/";

            int entryCount = _imgFile.Header.EntryCount;

            for (int i = 0; i < entryCount; i++)
            {
                TOCEntry entry = _imgFile.TOC[i];
                Common.File.DataLoadDelegate     load     = () => LoadData(entry);
                Common.File.DataStoreDelegate    store    = data => StoreData(entry, data);
                Common.File.DataIsCustomDelegate isCustom = () => entry.CustomData != null;

                var file = new Common.File(load, store, isCustom)
                {
                    CompressedSize  = entry.Size,
                    IsCompressed    = false,
                    Name            = _imgFile.TOC.GetName(i),
                    Size            = entry.Size,
                    IsResource      = entry.IsResourceFile,
                    ResourceType    = entry.ResourceType,
                    ParentDirectory = RootDirectory
                };

                RootDirectory.AddObject(file);
            }
        }
예제 #2
0
        private void BuildFS()
        {
            RootDirectory = new Directory();
            RootDirectory.Name = "/";

            int entryCount = _imgFile.Header.EntryCount;
            for (int i = 0; i < entryCount; i++)
            {
                TOCEntry entry = _imgFile.TOC[i];
                Common.File.DataLoadDelegate load = () => LoadData(entry);
                Common.File.DataStoreDelegate store = data => StoreData(entry, data);
                Common.File.DataIsCustomDelegate isCustom = () => entry.CustomData != null;

                var file = new Common.File(load, store, isCustom)
                               {
                                   CompressedSize = entry.Size,
                                   IsCompressed = false,
                                   Name = _imgFile.TOC.GetName(i),
                                   Size = entry.Size,
                                   IsResource = entry.IsResourceFile,
                                   ResourceType = entry.ResourceType,
                                   ParentDirectory = RootDirectory
                               };

                RootDirectory.AddObject(file);
            }
        }