bitburner-src/src/Corporation/ResearchMap.ts

20 lines
620 B
TypeScript
Raw Normal View History

// 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";
2021-04-30 05:52:56 +02:00
export const ResearchMap: IMap<Research> = {};
2021-05-01 09:17:31 +02:00
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);
}