UNPKG

unreal.js

Version:

A pak reader for games like VALORANT & Fortnite written in Node.JS

47 lines (46 loc) 1.61 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 { /** 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 { /** 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;