UNPKG

unpak.js

Version:

Modern TypeScript library for reading Unreal Engine pak files and assets, inspired by CUE4Parse

65 lines 2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FAssetBundleData = exports.FAssetBundleEntry = void 0; const SoftObjectPath_1 = require("../../objects/uobject/SoftObjectPath"); const FArchive_1 = require("../../reader/FArchive"); /** * A struct representing a single AssetBundle */ class FAssetBundleEntry { /** * Specific name of this bundle, should be unique for a given scope * @type {FName} * @public */ bundleName; /** * List of string assets contained in this bundle * @type {Array<FSoftObjectPath>} * @public */ bundleAssets; /** DO NOT USE THIS CONSTRUCTOR, THIS IS FOR THE LIBRARY */ constructor(x, y) { if (x instanceof FArchive_1.FArchive) { this.bundleName = x.readFName(); const len = x.readInt32(); this.bundleAssets = new Array(len); for (let i = 0; i < len; ++i) { this.bundleAssets[i] = new SoftObjectPath_1.FSoftObjectPath(x); } } else { this.bundleName = x; this.bundleAssets = y; } } } exports.FAssetBundleEntry = FAssetBundleEntry; /** * A struct with a list of asset bundle entries. * If one of these is inside a UObject it will get automatically exported as the asset registry tag AssetBundleData */ class FAssetBundleData { /** * List of bundles defined * @type {Array<FAssetBundleEntry>} * @public */ bundles; /** DO NOT USE THIS CONSTRUCTOR, THIS IS FOR THE LIBRARY */ constructor(x) { if (x instanceof FArchive_1.FArchive) { const len = x.readInt32(); this.bundles = new Array(len); for (let i = 0; i < len; ++i) { this.bundles[i] = new FAssetBundleEntry(x); } } else { this.bundles = x; } } } exports.FAssetBundleData = FAssetBundleData; //# sourceMappingURL=AssetBundleData.js.map