import type { BattleScenarioId } from '../data/battles'; import type { CampaignStep } from './campaignState'; const battleIdByCampaignStep: Partial> = { 'first-battle': 'first-battle-zhuo-commandery', 'second-battle': 'second-battle-yellow-turban-pursuit', 'third-battle': 'third-battle-guangzong-road', 'fourth-battle': 'fourth-battle-guangzong-camp', 'fifth-battle': 'fifth-battle-sishui-vanguard', 'sixth-battle': 'sixth-battle-jieqiao-relief', 'seventh-battle': 'seventh-battle-xuzhou-rescue', 'eighth-battle': 'eighth-battle-xiaopei-supply-road', 'ninth-battle': 'ninth-battle-xuzhou-gate-night-raid', 'tenth-battle': 'tenth-battle-xuzhou-breakout', 'eleventh-battle': 'eleventh-battle-xudu-refuge-road', 'twelfth-battle': 'twelfth-battle-xiapi-outer-siege', 'thirteenth-battle': 'thirteenth-battle-xiapi-final', 'fourteenth-battle': 'fourteenth-battle-cao-break', 'fifteenth-battle': 'fifteenth-battle-yuan-refuge-road', 'sixteenth-battle': 'sixteenth-battle-liu-biao-refuge', 'seventeenth-battle': 'seventeenth-battle-wolong-visit-road', 'eighteenth-battle': 'eighteenth-battle-bowang-ambush', 'nineteenth-battle': 'nineteenth-battle-changban-refuge', 'twentieth-battle': 'twentieth-battle-jiangdong-envoy', 'twenty-first-battle': 'twenty-first-battle-red-cliffs-vanguard', 'twenty-second-battle': 'twenty-second-battle-red-cliffs-fire', 'twenty-third-battle': 'twenty-third-battle-jingzhou-south-entry', 'twenty-fourth-battle': 'twenty-fourth-battle-guiyang-persuasion', 'twenty-fifth-battle': 'twenty-fifth-battle-wuling-mountain-road', 'twenty-sixth-battle': 'twenty-sixth-battle-changsha-veteran', 'twenty-seventh-battle': 'twenty-seventh-battle-yizhou-relief-road', 'twenty-eighth-battle': 'twenty-eighth-battle-fu-pass-entry', 'twenty-ninth-battle': 'twenty-ninth-battle-luo-outer-wall', 'thirtieth-battle': 'thirtieth-battle-luofeng-ambush', 'thirty-first-battle': 'thirty-first-battle-luo-main-gate', 'thirty-second-battle': 'thirty-second-battle-mianzhu-gate', 'thirty-third-battle': 'thirty-third-battle-chengdu-surrender', 'thirty-fourth-battle': 'thirty-fourth-battle-jiameng-pass', 'thirty-fifth-battle': 'thirty-fifth-battle-yangping-scout', 'thirty-sixth-battle': 'thirty-sixth-battle-dingjun-vanguard', 'thirty-seventh-battle': 'thirty-seventh-battle-hanzhong-decisive', 'thirty-eighth-battle': 'thirty-eighth-battle-jing-defense', 'thirty-ninth-battle': 'thirty-ninth-battle-fan-castle-vanguard', 'fortieth-battle': 'fortieth-battle-han-river-flood', 'forty-first-battle': 'forty-first-battle-fan-castle-siege', 'forty-second-battle': 'forty-second-battle-jing-rear-crisis', 'forty-third-battle': 'forty-third-battle-gongan-collapse', 'forty-fourth-battle': 'forty-fourth-battle-maicheng-isolation', 'forty-fifth-battle': 'forty-fifth-battle-yiling-vanguard', 'forty-sixth-battle': 'forty-sixth-battle-yiling-fire', 'forty-seventh-battle': 'forty-seventh-battle-nanzhong-stabilization', 'forty-eighth-battle': 'forty-eighth-battle-meng-huo-main-force', 'forty-ninth-battle': 'forty-ninth-battle-meng-huo-second-capture', 'fiftieth-battle': 'fiftieth-battle-meng-huo-third-capture', 'fifty-first-battle': 'fifty-first-battle-meng-huo-fourth-capture', 'fifty-second-battle': 'fifty-second-battle-meng-huo-fifth-capture', 'fifty-third-battle': 'fifty-third-battle-meng-huo-sixth-capture', 'fifty-fourth-battle': 'fifty-fourth-battle-meng-huo-final-capture', 'fifty-fifth-battle': 'fifty-fifth-battle-northern-qishan-road', 'fifty-sixth-battle': 'fifty-sixth-battle-tianshui-advance', 'fifty-seventh-battle': 'fifty-seventh-battle-jieting-crisis', 'fifty-eighth-battle': 'fifty-eighth-battle-qishan-retreat', 'fifty-ninth-battle': 'fifty-ninth-battle-chencang-siege', 'sixtieth-battle': 'sixtieth-battle-wudu-yinping', 'sixty-first-battle': 'sixty-first-battle-hanzhong-rain-defense', 'sixty-second-battle': 'sixty-second-battle-qishan-renewed-offensive', 'sixty-third-battle': 'sixty-third-battle-lucheng-pursuit', 'sixty-fourth-battle': 'sixty-fourth-battle-weishui-camps', 'sixty-fifth-battle': 'sixty-fifth-battle-weishui-northbank', 'sixty-sixth-battle': 'sixty-sixth-battle-wuzhang-final' }; export function battleIdForCampaignStep(step: CampaignStep) { return battleIdByCampaignStep[step]; } export function campaignBattleRouteEntries() { return Object.entries(battleIdByCampaignStep) .filter((entry): entry is [CampaignStep, BattleScenarioId] => Boolean(entry[1])) .map(([step, battleId]) => ({ step, battleId })); } export function isCampCampaignStep(step: CampaignStep) { return step.endsWith('-camp'); }