mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #1808 from theit8514/move-getownedsourcefiles
Move getOwnedSourceFiles to NS namespace
This commit is contained in:
commit
2b7acf6012
2
dist/bitburner.d.ts
vendored
2
dist/bitburner.d.ts
vendored
@ -4085,8 +4085,6 @@ export declare interface Singularity {
|
||||
* @remarks
|
||||
* RAM cost: 5 GB
|
||||
*
|
||||
* Singularity - Level 3
|
||||
*
|
||||
* Returns an array of source files
|
||||
*
|
||||
* @returns Array containing an object with number and level of the source file.
|
||||
|
@ -63,7 +63,7 @@ import { NetscriptGang } from "./NetscriptFunctions/Gang";
|
||||
import { NetscriptSleeve } from "./NetscriptFunctions/Sleeve";
|
||||
import { NetscriptExtra } from "./NetscriptFunctions/Extra";
|
||||
import { NetscriptHacknet } from "./NetscriptFunctions/Hacknet";
|
||||
import { NS as INS, Player as INetscriptPlayer } from "./ScriptEditor/NetscriptDefinitions";
|
||||
import { NS as INS, Player as INetscriptPlayer, SourceFileLvl } from "./ScriptEditor/NetscriptDefinitions";
|
||||
import { NetscriptBladeburner } from "./NetscriptFunctions/Bladeburner";
|
||||
import { NetscriptCodingContract } from "./NetscriptFunctions/CodingContract";
|
||||
import { NetscriptCorporation } from "./NetscriptFunctions/Corporation";
|
||||
@ -2150,7 +2150,17 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
updateDynamicRam("getFavorToDonate", getRamCost("getFavorToDonate"));
|
||||
return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);
|
||||
},
|
||||
|
||||
getOwnedSourceFiles: function (): SourceFileLvl[] {
|
||||
helper.updateDynamicRam("getOwnedSourceFiles", getRamCost("getOwnedSourceFiles"));
|
||||
const res: SourceFileLvl[] = [];
|
||||
for (let i = 0; i < Player.sourceFiles.length; ++i) {
|
||||
res.push({
|
||||
n: Player.sourceFiles[i].n,
|
||||
lvl: Player.sourceFiles[i].lvl,
|
||||
} as SourceFileLvl);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
getPlayer: function (): INetscriptPlayer {
|
||||
helper.updateDynamicRam("getPlayer", getRamCost("getPlayer"));
|
||||
|
||||
|
@ -105,18 +105,6 @@ export function NetscriptSingularity(
|
||||
}
|
||||
return res;
|
||||
},
|
||||
getOwnedSourceFiles: function (): any {
|
||||
helper.updateDynamicRam("getOwnedSourceFiles", getRamCost("getOwnedSourceFiles"));
|
||||
helper.checkSingularityAccess("getOwnedSourceFiles", 3);
|
||||
const res = [];
|
||||
for (let i = 0; i < player.sourceFiles.length; ++i) {
|
||||
res.push({
|
||||
n: player.sourceFiles[i].n,
|
||||
lvl: player.sourceFiles[i].lvl,
|
||||
});
|
||||
}
|
||||
return res;
|
||||
},
|
||||
getAugmentationsFromFaction: function (facname: any): any {
|
||||
helper.updateDynamicRam("getAugmentationsFromFaction", getRamCost("getAugmentationsFromFaction"));
|
||||
helper.checkSingularityAccess("getAugmentationsFromFaction", 3);
|
||||
|
24
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
24
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1747,19 +1747,6 @@ export interface Singularity {
|
||||
*/
|
||||
getOwnedAugmentations(purchased?: boolean): string[];
|
||||
|
||||
/**
|
||||
* Get a list of acquired Source-Files.
|
||||
* @remarks
|
||||
* RAM cost: 5 GB
|
||||
*
|
||||
* Singularity - Level 3
|
||||
*
|
||||
* Returns an array of source files
|
||||
*
|
||||
* @returns Array containing an object with number and level of the source file.
|
||||
*/
|
||||
getOwnedSourceFiles(): SourceFileLvl[];
|
||||
|
||||
/**
|
||||
* Get a list of augmentation available from a faction.
|
||||
* @remarks
|
||||
@ -4978,6 +4965,17 @@ export interface NS extends Singularity {
|
||||
*/
|
||||
getBitNodeMultipliers(): BitNodeMultipliers;
|
||||
|
||||
/**
|
||||
* Get a list of acquired Source-Files.
|
||||
* @remarks
|
||||
* RAM cost: 5 GB
|
||||
*
|
||||
* Returns an array of source files
|
||||
*
|
||||
* @returns Array containing an object with number and level of the source file.
|
||||
*/
|
||||
getOwnedSourceFiles(): SourceFileLvl[];
|
||||
|
||||
/**
|
||||
* Get information about the player.
|
||||
* @returns Player info
|
||||
|
Loading…
Reference in New Issue
Block a user