feat: add initial Pokémon map data and loader

- Introduced a new JSON file `map_pokemon_v1.json` containing detailed city data for the Pokémon map, including attributes like population, agriculture, commerce, and connections.
- Implemented a map loader in `mapLoader.ts` to read and parse map definitions from JSON files, allowing for dynamic loading of map data.
- Created a script `generate-map-data.mjs` to convert legacy PHP map data into the new JSON format, ensuring compatibility with the updated map system.
This commit is contained in:
2025-12-29 05:59:15 +00:00
parent 9fe4c8f96c
commit 124b070dc9
12 changed files with 23074 additions and 109 deletions
@@ -7,8 +7,8 @@ import {
type WorldSeedPayload,
} from '@sammo-ts/logic';
import type { LegacyMapLoaderOptions } from './legacyMapLoader.js';
import { loadLegacyMapDefinition } from './legacyMapLoader.js';
import type { MapLoaderOptions } from './mapLoader.js';
import { loadMapDefinitionByName } from './mapLoader.js';
import type { ScenarioLoaderOptions } from './scenarioLoader.js';
import { loadScenarioDefinitionById } from './scenarioLoader.js';
@@ -20,7 +20,7 @@ export interface ScenarioSeedOptions {
scenarioId: number;
databaseUrl: string;
scenarioOptions?: ScenarioLoaderOptions;
mapOptions?: LegacyMapLoaderOptions;
mapOptions?: MapLoaderOptions;
resetTables?: boolean;
now?: Date;
tickSeconds?: number;
@@ -93,7 +93,7 @@ export const seedScenarioToDatabase = async (
options.scenarioId,
options.scenarioOptions
);
const map = await loadLegacyMapDefinition(
const map = await loadMapDefinitionByName(
scenario.config.environment.mapName,
options.mapOptions
);