VARIOUS: Various changes prior to release 2.2 (#271)

See PR #271 description
This commit is contained in:
Snarling
2022-12-29 20:28:53 -05:00
committed by GitHub
parent 24ad342203
commit fb1f95c26e
310 changed files with 3768 additions and 2583 deletions
+11 -4
View File
@@ -1,12 +1,12 @@
import { Player } from "@player";
import { StaticAugmentations } from "../Augmentation/StaticAugmentations";
import { CityName } from "../Locations/data/CityNames";
import { CityName } from "../Enums";
import { findCrime } from "../Crime/CrimeHelpers";
import { Augmentation } from "../Augmentation/Augmentation";
import { Sleeve } from "../ScriptEditor/NetscriptDefinitions";
import { Sleeve } from "@nsdefs";
import { checkEnum } from "../utils/helpers/enum";
import { InternalAPI, NetscriptContext } from "../Netscript/APIWrapper";
import { InternalAPI, NetscriptContext, removedFunction } from "../Netscript/APIWrapper";
import { isSleeveBladeburnerWork } from "../PersonObjects/Sleeve/Work/SleeveBladeburnerWork";
import { isSleeveFactionWork } from "../PersonObjects/Sleeve/Work/SleeveFactionWork";
import { isSleeveCompanyWork } from "../PersonObjects/Sleeve/Work/SleeveCompanyWork";
@@ -31,7 +31,7 @@ export function NetscriptSleeve(): InternalAPI<Sleeve> {
}
};
return {
const sleeveFunctions: InternalAPI<Sleeve> = {
getNumSleeves: (ctx) => () => {
checkSleeveAPIAccess(ctx);
return Player.sleeves.length;
@@ -254,4 +254,11 @@ export function NetscriptSleeve(): InternalAPI<Sleeve> {
return Player.sleeves[sleeveNumber].bladeburner(action, contract);
},
};
// Removed undocumented functions added using Object.assign because typescript.
// TODO: Remove these at 3.0
Object.assign(sleeveFunctions, {
getSleeveStats: removedFunction("2.2.0", "sleeve.getSleeve"),
getSleeveInformation: removedFunction("2.2.0", "sleeve.getSleeve"),
});
return sleeveFunctions;
}