C# Класс NanoByte.Common.Storage.SlimDX.ContentManager

Provides a virtual file system for combining data from multiple directories and archives (useful for modding).
Показать файл Открыть проект

Открытые методы

Метод Описание
DeleteModFile ( [ type, [ id ) : void

Deletes a file in ModDir. Will not touch files in archives or in BaseDir.

FileExists ( [ type, [ id, bool searchArchives = true ) : bool

Checks whether a certain content file exists.

GetFileList ( [ type, [ extension ) : NamedCollection

Gets a list of all files of a certain type

GetFileStream ( [ type, [ id ) : Stream

Gets a reading stream for a content file (searches in archives)

LoadArchives ( ) : void

Loads any ArchiveFileExt archives in BaseDir and ModDir or specified by EnvVarNameBaseArchives or EnvVarNamerModArchives.

Приватные методы

Метод Описание
AddArchivesToList ( NamedCollection files, string type, string extension, ContentArchiveEntry>.IEnumerable archiveData, bool flagAsMod ) : void

Finds all files in archiveData ending with extension and adds them to the files collection

AddDirectoryToList ( NamedCollection files, string type, string extension, DirectoryInfo directory, string prefix, bool flagAsMod ) : void

Recursively finds all files in directory ending with extension and adds them to the files list.

AddEntry ( ContentArchiveEntry>.this dictionary, ZipEntry zipEntry, ZipFile zipFile ) : void
AddFileToList ( NamedCollection files, string type, string name, bool flagAsMod ) : void

Adds a specific file to the files list.

CloseArchives ( ) : void
CreateDirPath ( [ type ) : string
CreateFilePath ( [ type, [ id ) : string
GetFilePath ( [ type, [ id ) : string
LoadArchive ( string path, ContentArchiveEntry>.Dictionary archiveEntries ) : void

Описание методов

DeleteModFile() публичный статический Метод

Deletes a file in ModDir. Will not touch files in archives or in BaseDir.
is not set. The specified file could not be found. The specified file could not be deleted. You have insufficient rights to delete the file.
public static DeleteModFile ( [ type, [ id ) : void
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
Результат void

FileExists() публичный статический Метод

Checks whether a certain content file exists.
public static FileExists ( [ type, [ id, bool searchArchives = true ) : bool
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
searchArchives bool Whether to search for the file in archives as well.
Результат bool

GetFileList() публичный статический Метод

Gets a list of all files of a certain type
public static GetFileList ( [ type, [ extension ) : NamedCollection
type [ The type of files you want (e.g. Textures, Sounds, ...)
extension [ The file extension to so search for
Результат NamedCollection

GetFileStream() публичный статический Метод

Gets a reading stream for a content file (searches in archives)
The specified file could not be found. There was an error reading the file. Read access to the file is not permitted.
public static GetFileStream ( [ type, [ id ) : Stream
type [ The type of file (e.g. Textures, Sounds, ...).
id [ The file name of the content.
Результат Stream

LoadArchives() публичный статический Метод

Loads any ArchiveFileExt archives in BaseDir and ModDir or specified by EnvVarNameBaseArchives or EnvVarNamerModArchives.
public static LoadArchives ( ) : void
Результат void