import type { City, MapDefinition } from '@sammo-ts/logic';

export const LARGE_TEST_MAP: MapDefinition = {
    id: 'large_test_map',
    name: '대형 테스트 맵',
    cities: [
        {
            id: 1,
            name: '소성A',
            level: 5,
            region: 1,
            position: { x: 10, y: 10 },
            connections: [2, 3],
            max: {
                population: 300000,
                agriculture: 4000,
                commerce: 4000,
                security: 4000,
                defence: 4000,
                wall: 4000,
            },
            initial: {
                population: 150000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 2,
            name: '중성B',
            level: 6,
            region: 1,
            position: { x: 20, y: 10 },
            connections: [1, 4],
            max: {
                population: 400000,
                agriculture: 6000,
                commerce: 6000,
                security: 6000,
                defence: 6000,
                wall: 6000,
            },
            initial: {
                population: 200000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 3,
            name: '대성C',
            level: 7,
            region: 2,
            position: { x: 10, y: 20 },
            connections: [1, 5],
            max: {
                population: 500000,
                agriculture: 8000,
                commerce: 8000,
                security: 8000,
                defence: 8000,
                wall: 8000,
            },
            initial: {
                population: 250000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 4,
            name: '특성D',
            level: 8,
            region: 2,
            position: { x: 30, y: 10 },
            connections: [2, 5],
            max: {
                population: 600000,
                agriculture: 10000,
                commerce: 10000,
                security: 10000,
                defence: 10000,
                wall: 10000,
            },
            initial: {
                population: 300000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 5,
            name: '소성E',
            level: 5,
            region: 3,
            position: { x: 20, y: 20 },
            connections: [3, 4, 6],
            max: {
                population: 300000,
                agriculture: 4000,
                commerce: 4000,
                security: 4000,
                defence: 4000,
                wall: 4000,
            },
            initial: {
                population: 150000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 6,
            name: '중성F',
            level: 6,
            region: 3,
            position: { x: 30, y: 20 },
            connections: [5, 7],
            max: {
                population: 400000,
                agriculture: 6000,
                commerce: 6000,
                security: 6000,
                defence: 6000,
                wall: 6000,
            },
            initial: {
                population: 200000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 7,
            name: '대성G',
            level: 7,
            region: 4,
            position: { x: 40, y: 20 },
            connections: [6, 8],
            max: {
                population: 500000,
                agriculture: 8000,
                commerce: 8000,
                security: 8000,
                defence: 8000,
                wall: 8000,
            },
            initial: {
                population: 250000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 8,
            name: '특성H',
            level: 8,
            region: 4,
            position: { x: 50, y: 20 },
            connections: [7, 9],
            max: {
                population: 600000,
                agriculture: 10000,
                commerce: 10000,
                security: 10000,
                defence: 10000,
                wall: 10000,
            },
            initial: {
                population: 300000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
        {
            id: 9,
            name: '소성I',
            level: 5,
            region: 5,
            position: { x: 60, y: 20 },
            connections: [8],
            max: {
                population: 300000,
                agriculture: 4000,
                commerce: 4000,
                security: 4000,
                defence: 4000,
                wall: 4000,
            },
            initial: {
                population: 150000,
                agriculture: 1000,
                commerce: 1000,
                security: 1000,
                defence: 1000,
                wall: 1000,
            },
        },
    ],
    defaults: { trust: 90, trade: 100, supplyState: 1, frontState: 0 },
};

export const buildLargeTestCities = (): City[] =>
    LARGE_TEST_MAP.cities.map((city) => ({
        id: city.id,
        name: city.name,
        nationId: 0,
        level: city.level,
        state: 0,
        population: city.initial.population,
        populationMax: city.max.population,
        agriculture: city.initial.agriculture,
        agricultureMax: city.max.agriculture,
        commerce: city.initial.commerce,
        commerceMax: city.max.commerce,
        security: city.initial.security,
        securityMax: city.max.security,
        supplyState: 1,
        frontState: 0,
        defence: city.initial.defence,
        defenceMax: city.max.defence,
        wall: city.initial.wall,
        wallMax: city.max.wall,
        meta: { trust: 95 },
    }));
