C# Класс ALFA.ResourceManager

This class implements a resource loader that is compatible with the game's internal resource loader. It can be used to load up files out of the currently loaded module, haks, or game data zip files.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
GetAllResources ( ) : IEnumerable

Get a list of all resources.

GetResource ( OEIResRef ResRef, ushort ResType ) : IResourceEntry

Get a resource by name.

GetResource ( string ResRef, ushort ResType ) : IResourceEntry

Get a resource by name.

GetResourcesByType ( ushort ResType ) : IEnumerable

Get a list of all resources of a given type. Duplicates may exist in the returned list, but the list is ordered in priority order, with the first entry being the most precedent for a given name.

LoadCoreResources ( ) : void

Initiate a load of core module resources only (no haks or zips). The load must be initiated before any resources are requested.

OpenGffResource ( string ResRef, ushort ResType ) : GFFFile

Open a GFF resource by name.

OpenModuleIfo ( ) : GFFFile

This method opens module.ifo for read as a GFF reader.

OpenTwoDAResource ( string ResRef, ushort ResType ) : TwoDAFile

Open a 2DA resource by name

ResourceManager ( string ModuleResName ) : System

Create a new ResourceManager instance.

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

Метод Описание
AddModuleCampaign ( GFFFile ModuleIfo, string HomeDirectory, string InstallDirectory ) : void

This routine scans module.ifo for a campaign GUID. If found, a campaign.cam file with the same GUID is searched for and its containing directory is added to the directory resource list.

AddModuleHaks ( GFFFile ModuleIfo, string HomeDirectory, string InstallDirectory ) : void

This routine scans module.ifo for haks to add to the hak list.

LoadResourceRepositories ( ) : void

This method performs demand loading of resource repositories.

LoadResourceRepositories ( bool ModuleOnly ) : void

This method performs demand loading of resource repositories.

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

GetAllResources() публичный Метод

Get a list of all resources.
public GetAllResources ( ) : IEnumerable
Результат IEnumerable

GetResource() публичный Метод

Get a resource by name.
public GetResource ( OEIResRef ResRef, ushort ResType ) : IResourceEntry
ResRef OEIResRef Supplies the resref to open.
ResType ushort Supplies the restype code of the resource.
Результат IResourceEntry

GetResource() публичный Метод

Get a resource by name.
public GetResource ( string ResRef, ushort ResType ) : IResourceEntry
ResRef string Supplies the resref to open.
ResType ushort Supplies the restype code of the resource.
Результат IResourceEntry

GetResourcesByType() публичный Метод

Get a list of all resources of a given type. Duplicates may exist in the returned list, but the list is ordered in priority order, with the first entry being the most precedent for a given name.
public GetResourcesByType ( ushort ResType ) : IEnumerable
ResType ushort Supplies the resource type to search for.
Результат IEnumerable

LoadCoreResources() публичный Метод

Initiate a load of core module resources only (no haks or zips). The load must be initiated before any resources are requested.
public LoadCoreResources ( ) : void
Результат void

OpenGffResource() публичный Метод

Open a GFF resource by name.
public OpenGffResource ( string ResRef, ushort ResType ) : GFFFile
ResRef string Supplies the resref to open.
ResType ushort Supplies the restype code of the resource.
Результат GFFFile

OpenModuleIfo() публичный Метод

This method opens module.ifo for read as a GFF reader.
public OpenModuleIfo ( ) : GFFFile
Результат GFFFile

OpenTwoDAResource() публичный Метод

Open a 2DA resource by name
public OpenTwoDAResource ( string ResRef, ushort ResType ) : TwoDAFile
ResRef string Supplies the resref to open
ResType ushort Supplies the restype code of the resource
Результат TwoDAFile

ResourceManager() публичный Метод

Create a new ResourceManager instance.
public ResourceManager ( string ModuleResName ) : System
ModuleResName string Optionally supplies the resource name /// of the module. If null, it will be attempted to be gotten from the /// command line of the server, but this can fail if the server was /// not started with -module on the command line.
Результат System