Revert "API: Renamed Division.type to Division.industry (#2079)" (#2138)

This reverts commit 7a3c18fcf2.
This commit is contained in:
David Walker
2025-05-17 22:58:02 -07:00
committed by GitHub
parent 43e5589e61
commit f4e70720a6
11 changed files with 41 additions and 49 deletions
+4 -12
View File
@@ -94,8 +94,8 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
}
function getResearchCost(division: Division, researchName: CorpResearchName): number {
const researchTree = IndustryResearchTrees[division.industry];
if (researchTree === undefined) throw new Error(`No research tree for industry '${division.industry}'`);
const researchTree = IndustryResearchTrees[division.type];
if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);
const allResearch = researchTree.getAllNodes();
if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);
const research = ResearchMap[researchName];
@@ -157,9 +157,9 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
function getSafeDivision(division: Division): NSDivision {
const cities = getRecordKeys(division.offices);
const data = {
return {
name: division.name,
industry: division.industry,
type: division.type,
awareness: division.awareness,
popularity: division.popularity,
productionMult: division.productionMult,
@@ -174,14 +174,6 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
makesProducts: division.makesProducts,
maxProducts: division.maxProducts,
};
setDeprecatedProperties(data, {
type: {
identifier: "ns.corporation.getDivision().type",
message: "Use ns.corporation.getDivision().industry instead.",
value: data.industry,
},
});
return data;
}
const warehouseAPI: InternalAPI<WarehouseAPI> = {