Example #1
0
        internal void AddFile(FileScheme scheme, IFileCollection collection, IAssemblyManager manager)
        {
            switch (scheme.SchemeType)
            {
            case FileEntryType.Serialized:
            {
                SerializedFileScheme serializedScheme = (SerializedFileScheme)scheme;
                SerializedFile       file             = serializedScheme.ReadFile(collection, manager);
                m_serializedFiles.Add(file);
                OnSerializedFileAdded(file);
            }
            break;

            case FileEntryType.Bundle:
            {
                BundleFileScheme bundleScheme = (BundleFileScheme)scheme;
                BundleFile       bundle       = bundleScheme.ReadFile(collection, manager);
                m_fileLists.Add(bundle);
                OnFileListAdded(bundle);
            }
            break;

            case FileEntryType.Archive:
            {
                ArchiveFileScheme archiveScheme = (ArchiveFileScheme)scheme;
                ArchiveFile       archive       = archiveScheme.ReadFile(collection, manager);
                m_fileLists.Add(archive);
                OnFileListAdded(archive);
            }
            break;

            case FileEntryType.Web:
            {
                WebFileScheme webScheme = (WebFileScheme)scheme;
                WebFile       webFile   = webScheme.ReadFile(collection, manager);
                m_fileLists.Add(webFile);
                OnFileListAdded(webFile);
            }
            break;

            case FileEntryType.Resource:
            {
                ResourceFileScheme resourceScheme = (ResourceFileScheme)scheme;
                ResourceFile       resource       = resourceScheme.ReadFile();
                m_resourceFiles.Add(resource);
                OnResourceFileAdded(resource);
            }
            break;

            default:
                throw new NotSupportedException(scheme.SchemeType.ToString());
            }
        }
Example #2
0
        internal void AddFile(GameProcessorContext context, FileScheme scheme)
        {
            switch (scheme.SchemeType)
            {
            case FileEntryType.Serialized:
            {
                SerializedFileScheme serializedScheme = (SerializedFileScheme)scheme;
                SerializedFile       file             = serializedScheme.ReadFile(context);
                AddSerializedFile(file);
            }
            break;

            case FileEntryType.Bundle:
            {
                BundleFileScheme bundleScheme = (BundleFileScheme)scheme;
                BundleFile       bundle       = bundleScheme.ReadFile(context);
                AddFileList(bundle);
            }
            break;

            case FileEntryType.Archive:
            {
                ArchiveFileScheme archiveScheme = (ArchiveFileScheme)scheme;
                ArchiveFile       archive       = archiveScheme.ReadFile(context);
                AddFileList(archive);
            }
            break;

            case FileEntryType.Web:
            {
                WebFileScheme webScheme = (WebFileScheme)scheme;
                WebFile       webFile   = webScheme.ReadFile(context);
                AddFileList(webFile);
            }
            break;

            case FileEntryType.Resource:
            {
                ResourceFileScheme resourceScheme = (ResourceFileScheme)scheme;
                ResourceFile       resource       = resourceScheme.ReadFile();
                AddResourceFile(resource);
            }
            break;

            default:
                throw new NotSupportedException(scheme.SchemeType.ToString());
            }
        }