mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
NETSCRIPT: Expose more enums for player use (#198)
* Add support for enums at other ns layers * APIWrapper: simplified wrapping algorithm and modified to just use cloneDeep to copy enums instead of recursively wrapping enums as if they were new API layers * Improve APIWrapper typing * Changed some typings at RamCostGenerator to allow for enums at different levels without enums needing a ram cost * Added enums to ns.corporation, removed getter functions that were being used instead. * Add FactionWorkType for player use * Add ClassType and CompanyWorkPos enums * Change netscriptDefinitions to expect members of these new enums where appropriate.
This commit is contained in:
@@ -120,6 +120,8 @@ describe("Netscript RAM Calculation/Generation Tests", function () {
|
||||
const expectedRam = grabCost(ramLayer, newPath);
|
||||
it(`${fnName}()`, () => combinedRamCheck(val, newPath, expectedRam, extraLayerCost));
|
||||
}
|
||||
//Skip enums layers
|
||||
else if (key === "enums") return;
|
||||
//A layer should be the only other option.
|
||||
else testLayer(val, ramLayer[key] as RamLayer, newPath, 0);
|
||||
});
|
||||
@@ -141,7 +143,12 @@ describe("Netscript RAM Calculation/Generation Tests", function () {
|
||||
it(`SF4.${lvl} check for x${lvlToMult[lvl]} costs`, () => {
|
||||
sf4.lvl = lvl;
|
||||
singObjects.forEach((obj) =>
|
||||
combinedRamCheck(obj.fn, ["singularity", obj.name], obj.baseRam * lvlToMult[lvl], 0),
|
||||
combinedRamCheck(
|
||||
obj.fn as PotentiallyAsyncFunction,
|
||||
["singularity", obj.name],
|
||||
obj.baseRam * lvlToMult[lvl],
|
||||
0,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user