This commit is contained in:
Snarling
2022-10-03 12:12:16 -04:00
parent ab56d18e1e
commit 50f14b4f58
67 changed files with 307 additions and 599 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
import { Player } from "../Player";
import { IMap } from "../types";
import { NS as INS } from "../ScriptEditor/NetscriptDefinitions";
import { INetscriptExtra } from "../NetscriptFunctions/Extra";
@@ -15,7 +14,7 @@ type RamCostTree<API> = {
// TODO remember to update RamCalculations.js and WorkerScript.js
// RAM costs for Netscript functions
export const RamCostConstants: IMap<number> = {
export const RamCostConstants: Record<string, number> = {
ScriptBaseRamCost: 1.6,
ScriptDomRamCost: 25,
ScriptCorporationRamCost: 1024 - 1.6,
@@ -604,7 +603,7 @@ const SourceRamCosts = {
},
};
export const RamCosts: IMap<any> = SourceRamCosts;
export const RamCosts: Record<string, any> = SourceRamCosts;
// This line in particular is there so typescript typechecks that we are not missing any static ram cost.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
+3 -4
View File
@@ -13,7 +13,6 @@ import { RunningScript } from "../Script/RunningScript";
import { Script } from "../Script/Script";
import { GetServer } from "../Server/AllServers";
import { BaseServer } from "../Server/BaseServer";
import { IMap } from "../types";
import { NS } from "../ScriptEditor/NetscriptDefinitions";
import { ScriptDeath } from "./ScriptDeath";
import { ScriptArg } from "./ScriptArg";
@@ -43,14 +42,14 @@ export class WorkerScript {
/**
* Stores names of all functions that have logging disabled
*/
disableLogs: IMap<boolean> = {};
disableLogs: Record<string, boolean> = {};
/**
* Used for dynamic RAM calculation. Stores names of all functions that have
* already been checked by this script.
* TODO: Could probably just combine this with loadedFns?
*/
dynamicLoadedFns: IMap<boolean> = {};
dynamicLoadedFns: Record<string, boolean> = {};
/**
* Tracks dynamic RAM usage
@@ -71,7 +70,7 @@ export class WorkerScript {
* Used for static RAM calculation. Stores names of all functions that have
* already been checked by this script
*/
loadedFns: IMap<boolean> = {};
loadedFns: Record<string, boolean> = {};
/**
* Filename of script