mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Add ns.getFunctionRamCost (#526)
This commit is contained in:
@@ -93,6 +93,7 @@ import { ContentFilePath } from "./Paths/ContentFile";
|
||||
import { LiteratureName } from "./Literature/data/LiteratureNames";
|
||||
import { hasProgramExtension } from "./Paths/ProgramFilePath";
|
||||
import { hasContractExtension } from "./Paths/ContractFilePath";
|
||||
import { getRamCost } from "./Netscript/RamCostGenerator";
|
||||
|
||||
export const enums: NSEnums = {
|
||||
CityName,
|
||||
@@ -1737,6 +1738,10 @@ export const ns: InternalAPI<NSFull> = {
|
||||
lastNodeReset: Player.lastNodeReset,
|
||||
currentNode: Player.bitNodeN,
|
||||
}),
|
||||
getFunctionRamCost: (ctx) => (_name) => {
|
||||
const name = helpers.string(ctx, "name", _name);
|
||||
return getRamCost(...name.split("."));
|
||||
},
|
||||
flags: Flags,
|
||||
...NetscriptExtra(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user