/** * Static facts used by vehicle research and purchase rules, loaded once at startup from game * files. */ import type { DatasetCache } from '../game-data/datasets/dataset-cache.ts'; import { crewSlotPrices, eraRequirements, type CrewSlotPrices, type EraRequirements } from '../game-data/datasets/rank-settings.ts'; import { researchPointsPerGoldenEagle } from '../game-data/datasets/research-point-rate.ts'; import { vehicleCatalogue, type CatalogueVehicle } from '../game-data/datasets/vehicle-catalogue.ts'; import { vehicleUnlocks, type UnlockDefinition } from '../game-data/datasets/vehicle-unlocks.ts'; import type { ResearchTuning } from './research-tuning.ts'; import { TechTree } from './tech-tree.ts'; export interface ResearchRules { readonly techTree: TechTree; readonly eraRequirements: EraRequirements; readonly vehicleUnlocks: readonly UnlockDefinition[]; readonly crewSlotPrices: CrewSlotPrices; readonly researchPointsPerGoldenEagle: number; readonly researchTuning: ResearchTuning; } export function loadResearchRules( datasets: DatasetCache, researchTuning: ResearchTuning, vehicles: readonly CatalogueVehicle[] = datasets.load(vehicleCatalogue), ): ResearchRules { return { techTree: new TechTree(vehicles), eraRequirements: datasets.load(eraRequirements), vehicleUnlocks: datasets.load(vehicleUnlocks), crewSlotPrices: datasets.load(crewSlotPrices), researchPointsPerGoldenEagle: datasets.load(researchPointsPerGoldenEagle), researchTuning, }; }