|
MochiEngine
|
The pack catalog is a class that creates and owns file loaders and acts as a combined catalog for all of them at once. This means that opening pack A and pack B allows you to use GetFile with files that are in any or both of them. As it searches in reverse order of pack opening, files of the last opened packs are prioritized when using GetFile and HasFile, which allows you to "override" assets of a previous pack, allowing a simple but effective way of modding. Each file system inside the catalog starts at the root, so it is needed the same folder structure in two file systems to be able to override. Example: Pack A. More...
#include <PackCatalog.h>
Public Types | |
| enum | FileLoaderType { FileSystem = 0 , Packfile = 1 } |
Public Member Functions | |
| PackCatalog (FileLoaderType) | |
| Constructs the file loader with a loader type. | |
| void | OpenPack (const std::string &) |
| bool | ClosePack (const std::string &) |
| bool | IsPackOpen (const std::string &) |
| std::vector< char > | GetFile (const std::string &) const |
| bool | HasFile (const std::string &) const |
| std::vector< std::string > | GetAvailableFiles () const |
The pack catalog is a class that creates and owns file loaders and acts as a combined catalog for all of them at once. This means that opening pack A and pack B allows you to use GetFile with files that are in any or both of them. As it searches in reverse order of pack opening, files of the last opened packs are prioritized when using GetFile and HasFile, which allows you to "override" assets of a previous pack, allowing a simple but effective way of modding. Each file system inside the catalog starts at the root, so it is needed the same folder structure in two file systems to be able to override. Example: Pack A.
Lifecycle:
| Mochi::FS::PackCatalog::PackCatalog | ( | FileLoaderType | fileLoaderType | ) |
Constructs the file loader with a loader type.