mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473)
This commit is contained in:
@@ -50,7 +50,6 @@ import { canGetBonus, onExport } from "../ExportBonus";
|
||||
import { saveObject } from "../SaveObject";
|
||||
import { calculateCrimeWorkStats } from "../Work/Formulas";
|
||||
import { findEnumMember } from "../utils/helpers/enum";
|
||||
import { areFilesEqual } from "../Terminal/DirectoryHelpers";
|
||||
import { Engine } from "../engine";
|
||||
import { checkEnum } from "../utils/helpers/enum";
|
||||
|
||||
@@ -81,7 +80,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
//Run a script after reset
|
||||
if (!cbScript) return;
|
||||
const home = Player.getHomeComputer();
|
||||
const script = home.scripts.find((serverScript) => areFilesEqual(serverScript.filename, cbScript));
|
||||
const script = home.scripts.get(cbScript);
|
||||
if (!script) return;
|
||||
const ramUsage = script.getRamUsage(home.scripts);
|
||||
if (!ramUsage) {
|
||||
@@ -110,9 +109,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
return res;
|
||||
},
|
||||
getOwnedSourceFiles: () => () => {
|
||||
return Player.sourceFiles.map((sf) => {
|
||||
return { n: sf.n, lvl: sf.lvl };
|
||||
});
|
||||
return [...Player.sourceFiles].map(([n, lvl]) => ({ n, lvl }));
|
||||
},
|
||||
getAugmentationsFromFaction: (ctx) => (_facName) => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
|
||||
Reference in New Issue
Block a user