mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
WIP: Remove corp employees as objects (#143)
* Removed employees as objects from corporations * Remove employees from office JSON after loading / convert to new parameters * Showed down morale/etc gain; added optional position to hireEmployee * enum support for corp employee positions Mostly authored-by: Kelenius <kelenius@ya.ru>
This commit is contained in:
@@ -78,20 +78,26 @@ import { ScriptDeath } from "./Netscript/ScriptDeath";
|
||||
import { getBitNodeMultipliers } from "./BitNode/BitNode";
|
||||
import { assert, arrayAssert, stringAssert, objectAssert } from "./utils/helpers/typeAssertion";
|
||||
import { CrimeType } from "./utils/WorkType";
|
||||
import { EmployeePositions } from "./Corporation/EmployeePositions";
|
||||
|
||||
export const enums = {
|
||||
toast: ToastVariant,
|
||||
crimes: CrimeType,
|
||||
CrimeType,
|
||||
};
|
||||
|
||||
export type NSFull = Readonly<NS & INetscriptExtra>;
|
||||
|
||||
export function NetscriptFunctions(workerScript: WorkerScript): NSFull {
|
||||
return wrapAPI(workerScript, ns, workerScript.args.slice());
|
||||
const api = wrapAPI(workerScript, ns, workerScript.args.slice());
|
||||
// Example of conditionally adding optional spoilered content to enums
|
||||
if (Player.sourceFileLvl(3) > 0 || Player.bitNodeN === 3) {
|
||||
api.enums.corp = Object.assign({}, { EmployeePositions });
|
||||
}
|
||||
return api;
|
||||
}
|
||||
|
||||
const base: InternalAPI<NS> = {
|
||||
args: [],
|
||||
//The next line will error if enums does not match the definition in NetscriptDefinitions.d.ts
|
||||
enums,
|
||||
singularity: NetscriptSingularity(),
|
||||
gang: NetscriptGang(),
|
||||
|
||||
Reference in New Issue
Block a user