C# Class 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.
Afficher le fichier Open project: ALandFarAway/ALFA-Base-Resources Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

GetAllResources() public méthode

Get a list of all resources.
public GetAllResources ( ) : IEnumerable
Résultat IEnumerable

GetResource() public méthode

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.
Résultat IResourceEntry

GetResource() public méthode

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.
Résultat IResourceEntry

GetResourcesByType() public méthode

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.
Résultat IEnumerable

LoadCoreResources() public méthode

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
Résultat void

OpenGffResource() public méthode

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.
Résultat GFFFile

OpenModuleIfo() public méthode

This method opens module.ifo for read as a GFF reader.
public OpenModuleIfo ( ) : GFFFile
Résultat GFFFile

OpenTwoDAResource() public méthode

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
Résultat TwoDAFile

ResourceManager() public méthode

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.
Résultat System