mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Merge pull request #4069 from Mughur/corp
API: Corp functions now return copy of constant arrays instead of the original
This commit is contained in:
commit
5101b345ec
@ -877,20 +877,25 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
|||||||
return {
|
return {
|
||||||
...warehouseAPI,
|
...warehouseAPI,
|
||||||
...officeAPI,
|
...officeAPI,
|
||||||
getMaterialNames: () => (): string[] => {
|
getMaterialNames: (ctx: NetscriptContext) => (): string[] => {
|
||||||
return CorporationConstants.AllMaterials;
|
checkAccess(ctx);
|
||||||
|
return [...CorporationConstants.AllMaterials];
|
||||||
},
|
},
|
||||||
getIndustryTypes: () => (): string[] => {
|
getIndustryTypes: (ctx: NetscriptContext) => (): string[] => {
|
||||||
return CorporationConstants.AllIndustryTypes;
|
checkAccess(ctx);
|
||||||
|
return [...CorporationConstants.AllIndustryTypes];
|
||||||
},
|
},
|
||||||
getUnlockables: () => (): string[] => {
|
getUnlockables: (ctx: NetscriptContext) => (): string[] => {
|
||||||
return CorporationConstants.AllUnlocks;
|
checkAccess(ctx);
|
||||||
|
return [...CorporationConstants.AllUnlocks];
|
||||||
},
|
},
|
||||||
getUpgradeNames: () => (): string[] => {
|
getUpgradeNames: (ctx: NetscriptContext) => (): string[] => {
|
||||||
return CorporationConstants.AllUpgrades;
|
checkAccess(ctx);
|
||||||
|
return [...CorporationConstants.AllUpgrades];
|
||||||
},
|
},
|
||||||
getResearchNames: () => (): string[] => {
|
getResearchNames: (ctx: NetscriptContext) => (): string[] => {
|
||||||
return CorporationConstants.AllResearch;
|
checkAccess(ctx);
|
||||||
|
return [...CorporationConstants.AllResearch];
|
||||||
},
|
},
|
||||||
expandIndustry:
|
expandIndustry:
|
||||||
(ctx: NetscriptContext) =>
|
(ctx: NetscriptContext) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user