bitburner-src/src/Corporation/ResearchMap.ts
2021-09-04 19:09:30 -04:00

19 lines
599 B
TypeScript

// The Research Map is an object that holds all Corporation Research objects
// as values. They are identified by their names
import { Research, IConstructorParams } from "./Research";
import { researchMetadata } from "./data/ResearchMetadata";
import { IMap } from "../types";
export const ResearchMap: IMap<Research> = {};
function addResearch(p: IConstructorParams): void {
if (ResearchMap[p.name] != null) {
console.warn(`Duplicate Research being defined: ${p.name}`);
}
ResearchMap[p.name] = new Research(p);
}
for (const metadata of researchMetadata) {
addResearch(metadata);
}