2018-12-14 04:24:08 +01:00
|
|
|
// 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";
|
2018-12-14 04:24:08 +01:00
|
|
|
import { researchMetadata } from "./data/ResearchMetadata";
|
|
|
|
|
2022-10-03 18:12:16 +02:00
|
|
|
export const ResearchMap: Record<string, Research> = {};
|
2018-12-14 04:24:08 +01:00
|
|
|
|
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);
|
2018-12-14 04:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (const metadata of researchMetadata) {
|
2021-09-05 01:09:30 +02:00
|
|
|
addResearch(metadata);
|
2018-12-14 04:24:08 +01:00
|
|
|
}
|