bitburner-src/src/Corporation/ResearchMap.ts

18 lines
576 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
2021-09-05 01:09:30 +02:00
import { Research, IConstructorParams } from "./Research";
import { researchMetadata } from "./data/ResearchMetadata";
2022-10-03 18:12:16 +02:00
export const ResearchMap: Record<string, Research> = {};
2021-05-01 09:17:31 +02:00
function addResearch(p: IConstructorParams): void {
2021-09-05 01:09:30 +02:00
if (ResearchMap[p.name] != null) {
console.warn(`Duplicate Research being defined: ${p.name}`);
}
ResearchMap[p.name] = new Research(p);
}
for (const metadata of researchMetadata) {
2021-09-05 01:09:30 +02:00
addResearch(metadata);
}