-
Notifications
You must be signed in to change notification settings - Fork 1
/
ef1941.mjs.map
1 lines (1 loc) · 279 KB
/
ef1941.mjs.map
1
{"version":3,"file":"ef1941.mjs","sources":["../../src/engine/defs.ts","../../src/engine/codec.ts","../../src/engine/rng.ts","../../src/engine/grid.ts","../../src/engine/map-data.ts","../node_modules/tslib/tslib.es6.js","../../src/engine/scenarios.ts","../../src/config.ts","../../src/engine/map.ts","../../src/engine/oob-data.ts","../../src/engine/unit.ts","../../src/engine/oob.ts","../../src/engine/think.ts","../../src/engine/game.ts"],"sourcesContent":["import type {AnticColor} from '../antic/anticmodel';\n\ntype Flag = 0 | 1;\ninterface Point {lon: number, lat: number}\n\nfunction sum(xs: number[]): number {\n return xs.reduce((s: number, x: number) => s + x, 0);\n}\n\nfunction clamp(v: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, v));\n}\n\nfunction memoize<S, T>(fn: (x: S) => T): (x: S) => T {\n const cache = new Map<S, T>();\n const cached = function (x: S): T {\n if (!cache.has(x)) cache.set(x, fn(x));\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return cache.get(x)!;\n };\n return cached;\n}\n\n// mimic logic from STKTABlon looking for zeroed pins\n// see https://forums.atariage.com/topic/275027-joystick-value-logic/:\ninterface Direction {label: string, dlon: number, dlat: number, icon: number}\nconst enum DirectionKey {north, east, south, west}\nconst directions: Record<DirectionKey, Direction> = {\n [DirectionKey.north]: {label: 'N', dlon: 0, dlat: 1, icon: 0x81}, // up 1110 => 0\n [DirectionKey.east]: {label: 'E', dlon: -1, dlat: 0, icon: 0x82}, // right 0111 => 1\n [DirectionKey.south]: {label: 'S', dlon: 0, dlat: -1, icon: 0x83}, // down 1101 => 2\n [DirectionKey.west]: {label: 'W', dlon: 1, dlat: 0, icon: 0x84}, // left 1011 => 3\n} as const;\n\n// adds contrast color for optional labels\ninterface Weather {label: string, earth: AnticColor, contrast: AnticColor}\nconst enum WeatherKey {dry, mud, snow}\nconst weatherdata: Record<WeatherKey, Weather> = {\n [WeatherKey.dry]: {label: 'dry', earth: 0x10, contrast: 0x06},\n [WeatherKey.mud]: {label: 'mud', earth: 0x02, contrast: 0x06},\n [WeatherKey.snow]: {label: 'snow', earth: 0x0A, contrast: 0x04},\n} as const;\n\ninterface Player {\n label: string,\n unit: string,\n color: AnticColor,\n homedir: DirectionKey,\n supply: {\n sea: number, // allowed to trace by sea?\n freeze: number, // freeze test in snow?\n // failed trace attempts before OoS by weatherKey, e.g. German auto-fail in mud\n maxfail: readonly [number, number, number]\n }\n}\n// note we rely on Player.german = 1 - Player.russian and vice versa\nconst enum PlayerKey {German, Russian}\nconst players: Record<PlayerKey, Player> = {\n [PlayerKey.German]: {\n label: 'German', unit: 'CORPS', color: 0x0C, homedir: DirectionKey.west,\n supply: {sea: 1, maxfail: [24, 0, 16], freeze: 1}\n },\n [PlayerKey.Russian]: {\n label: 'Russian', unit: 'ARMY', color: 0x46, homedir: DirectionKey.east,\n supply: {sea: 0, maxfail: [24, 24, 24], freeze: 0}\n },\n } as const;\n\n// terrain types M.ASM: 8160 TERRTY\n// NB we store offence and defence modifiers so 0 is no effect, equivalent to orignal game's 2\n// OFFNC I.ASM:9080 1,1,1,1,1,1,2,2,1,0\n// DEFNC I.ASM:9080 2,3,3,2,2,2,1,1,2,0\n// movement costs (of 32/turn) come from D.ASM:5430 SSNCOD / 5440 TRNTAB\n// index by terrain, then inf=0, air/armor=1 and finally Weather enum\n// value of 128 means impassable, 0 means error (frozen terrain outside winter)\nconst enum TerrainKey {\n clear, mountain_forest, city, frozen_swamp, frozen_river,\n swamp, river, coastline, estuary, impassable\n}\ntype WeatherCosts = readonly [number, number, number];\ntype UnitKindCosts = readonly [WeatherCosts, WeatherCosts];\ninterface Terrain {\n label: string, color: AnticColor, altcolor?: AnticColor,\n offence: number, defence: number, movecost: UnitKindCosts\n}\nconst terraintypes: Record<TerrainKey, Terrain> = {\n [TerrainKey.clear]: {\n label: 'clear', color: 0x02,\n offence: 0, defence: 0, movecost: [[ 6, 24, 10], [ 4, 30, 6]]\n },\n [TerrainKey.mountain_forest]: {\n label: 'mountain/forest', color: 0x28, altcolor: 0xD6, // mtn + forest\n offence: 0, defence: 1, movecost: [[12, 30, 16], [ 8, 30, 10]]\n },\n [TerrainKey.city]: {\n label: 'city', color: 0x00, // will be colored based on player control\n offence: 0, defence: 1, movecost: [[ 8, 24, 10], [ 6, 30, 8]]\n },\n [TerrainKey.frozen_swamp]: {\n label: 'frozen swamp', color: 0x0C,\n offence: 0, defence: 0, movecost: [[ 0, 0, 12], [ 0, 0, 8]]\n },\n [TerrainKey.frozen_river]: {\n label: 'frozen river', color: 0x0C,\n offence: 0, defence: 0, movecost: [[ 0, 0, 12], [ 0, 0, 8]]\n },\n [TerrainKey.swamp]: {\n label: 'swamp', color: 0x94,\n offence: 0, defence: 0, movecost: [[18, 30, 24], [18, 30, 24]]\n },\n [TerrainKey.river]: {\n label: 'river', color: 0x94,\n offence: -1, defence: -1, movecost: [[14, 30, 28], [13, 30, 28]]\n },\n [TerrainKey.coastline]: {\n // strange that coastline acts like river but estuary doesn't?\n label: 'coastline', color: 0x94,\n offence: -1, defence: -1, movecost: [[ 8, 26, 12], [ 6, 30, 8]]\n },\n [TerrainKey.estuary]: {\n label: 'estuary', color: 0x94,\n offence: 0, defence: 0, movecost: [[20, 28, 24], [16, 30, 20]],\n },\n [TerrainKey.impassable]: {\n label: 'impassable', color: 0x94, altcolor: 0x0C, // sea + border(alt)\n offence: 0, defence: 0, movecost: [[0, 0, 0], [0, 0, 0]]\n }\n} as const;\n\ninterface WaterState {\n dir: DirectionKey, terrain: readonly[TerrainKey, TerrainKey]\n}\nconst enum WaterStateKey {freeze, thaw}\nconst waterstate: Record<WaterStateKey, WaterState> = {\n [WaterStateKey.freeze]: {\n dir: DirectionKey.south, terrain: [TerrainKey.frozen_swamp, TerrainKey.frozen_river]\n },\n [WaterStateKey.thaw]: {\n dir: DirectionKey.north, terrain: [TerrainKey.swamp, TerrainKey.river]\n },\n} as const;\n\n// combines D.asm:2690 TRTAB and 5430 SSNCOD, also annotated PDF p71 (labelled -63-)\ninterface Month {label: string, trees: AnticColor, weather: WeatherKey, water?: WaterStateKey}\nconst enum MonthKey {\n Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec\n}\nconst monthdata: Record<MonthKey, Month> = {\n [MonthKey.Jan]: {label: \"January\", trees: 0x12, weather: WeatherKey.snow},\n [MonthKey.Feb]: {label: \"February\", trees: 0x12, weather: WeatherKey.snow},\n [MonthKey.Mar]: {label: \"March\", trees: 0x12, weather: WeatherKey.snow, water: WaterStateKey.thaw},\n [MonthKey.Apr]: {label: \"April\", trees: 0xD2, weather: WeatherKey.mud},\n [MonthKey.May]: {label: \"May\", trees: 0xD8, weather: WeatherKey.dry},\n [MonthKey.Jun]: {label: \"June\", trees: 0xD6, weather: WeatherKey.dry},\n [MonthKey.Jul]: {label: \"July\", trees: 0xC4, weather: WeatherKey.dry},\n [MonthKey.Aug]: {label: \"August\", trees: 0xD4, weather: WeatherKey.dry},\n [MonthKey.Sep]: {label: \"September\", trees: 0xC2, weather: WeatherKey.dry},\n [MonthKey.Oct]: {label: \"October\", trees: 0x12, weather: WeatherKey.mud},\n [MonthKey.Nov]: {label: \"November\", trees: 0x12, weather: WeatherKey.snow, water: WaterStateKey.freeze},\n [MonthKey.Dec]: {label: \"December\", trees: 0x12, weather: WeatherKey.snow},\n} as const;\n\ninterface UnitKind {key: string, icon: number}\nconst enum UnitKindKey {infantry, armor, air}\nconst unitkinds: Record<UnitKindKey, UnitKind> = {\n [UnitKindKey.infantry]: {key: 'infantry', icon: 0x7d},\n [UnitKindKey.armor]: {key: 'armor', icon: 0x7e},\n [UnitKindKey.air]: {key: 'air', icon: 0x7c},\n} as const;\n\nexport type {Flag, Point};\n\nexport {\n sum, memoize, clamp,\n directions, DirectionKey,\n players, PlayerKey,\n terraintypes, TerrainKey,\n weatherdata, WeatherKey,\n waterstate, WaterStateKey,\n monthdata, MonthKey,\n unitkinds, UnitKindKey,\n}\n","/**\n * Contains a bunch of routines to compact various integer data into\n * a sequence of six-bit unsigned ints (uint6) which we map to\n * a base64-like encoding\n */\nimport {memoize} from './defs';\n\nconst chrs64 = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',\n 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',\n 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '-', '_'\n] as const;\n\ntype chr64 = typeof chrs64[number]\ntype uint6 = number;\ntype uint = number;\ntype int = number;\n\nconst chr2int = Object.fromEntries(chrs64.map((c,i) => [c, i])) as Record<chr64, uint6>,\n int2chr = Object.fromEntries(chrs64.map((c,i) => [i, c])) as Record<uint6, chr64>;\n\nfunction ischr64(c: string): c is chr64 {\n return (chrs64 as readonly string[]).includes(c);\n}\n\n/** test v is unsigned integer */\nfunction isuint(v: number): v is uint {\n return Number.isInteger(v) && v >= 0;\n}\n\n// memoized Fibonacci numbers\nconst fib = memoize((n: uint): uint => n < 2 ? n: fib(n-1) + fib(n-2));\n\n\nfunction seq2str(seq: uint6[]): string {\n if (seq.some(u => !isuint(u) || u >= 64))\n throw new Error(`seq2str: Invalid uint6 in input ${seq}`)\n return seq.map(u => int2chr[u]).join('');\n}\n\nfunction str2seq(s: string): uint6[] {\n const chrs = s.split('');\n if (!chrs.every(ischr64) )\n throw new Error(`str2seq: Unexpected characters in '${s}'`);\n return chrs.map(c => chr2int[c]);\n}\n\n/** convert payload to string, wrapping with optional prefix string, length marker, and CRC check */\nfunction wrap64(payload: uint6[], prefix: string, length_maxbits = 12): string {\n const seq = ([] as number[]).concat(\n bitsencode(payload.length, length_maxbits),\n payload,\n fletcher6(payload),\n );\n return (prefix || '') + seq2str(seq);\n}\n\n/** unwrap payload to seqas wrapped by wrap64, ignoring garbage and trailing characters */\nfunction unwrap64(s: string, prefix: string, length_maxbits = 12): uint6[] {\n prefix ||= '';\n\n // check prefix\n if (!s.startsWith(prefix)) throw new Error(`unwrap64: string didn't start with expected prefix '${prefix}'`);\n\n // remove prefix and extraenous characters, and convert to seq<uint64>\n const seq = str2seq(s.slice(prefix.length).replace(/[^-\\w]/g, ''));\n\n // get payload length\n const n = bitsdecode(seq, length_maxbits);\n if (seq.length < n + 2) {\n throw new Error(`unwrap: expected at least ${n} + 2 characters after length marker, got ${seq.length}`);\n }\n // get payload and compute checksum\n const payload = seq.slice(0, n),\n chk = fletcher6(payload);\n\n // validate checksum\n if (!chk.every((u, i) => u == seq[n+i]))\n throw new Error(`unwrap64: checksum mismatch got ${s.slice(0, 2)}, expected ${chk}`);\n return payload;\n}\n\n/**\n * computes achecksum for sequence as a typle\n * using a six bit version of the Fletcher checksum\n */\nfunction fletcher6(seq: uint6[], modulus = 61): [uint6, uint6] {\n let x = 0, y = 0;\n seq.forEach(u => {\n x = (x + u) % modulus;\n y = (y + x) % modulus;\n });\n return [x, y];\n}\n\n/**\n * Encode a fixed-size uint of up to 1<<nbits as a seq of uint6\n */\nfunction bitsencode(n: uint, nbits: uint): uint6[] {\n if (!isuint(n) || n >= (1<<nbits))\n throw new Error(`bitsencode: value ${n} exceeds max ${1 << nbits}`)\n const seq: number[] = [];\n for (let i=0; i<Math.ceil(nbits/6); i++) {\n seq.push(n & 0x3f);\n n >>= 6;\n }\n return seq;\n}\n\n/**\n * Decode a fixed-size value of up to nbits from a seq<uint6>\n * modifying seq in place\n */\nfunction bitsdecode(seq: uint6[], nbits: uint): uint {\n const nchars = Math.ceil(nbits/6);\n if (nchars > seq.length) {\n throw new Error(`bitsdecode: expected at least ${nchars} characters, got ${seq.length}`);\n }\n let n = 0;\n seq.splice(0, nchars).reverse().forEach(u => {n = (n << 6) + u});\n return n;\n}\n\n/** Fibnonacci encode a single uint to a uint with prefix-free bit pattern,\n * returned as a value >= 3 (b000011)\n * see https://en.wikipedia.org/wiki/Fibonacci_coding\n */\nfunction _fibencode_uint(n: uint): uint {\n if (!isuint(n)) throw new Error(`fibencode_uint: Invalid unsigned integer: ${n}`)\n\n let n1 = n + 1, // fib coding wants a natural number rather than a unit, i.e. 0 => 1\n k: number,\n bits = 1;\n for(k=2; fib(k) <= n1; k++) /**/ ; // k is index of largest fibonacci number in n1\n // create the fibonacci bit pattern by flagging presence/absence of each smaller number\n for(--k; k >= 2; k--) {\n bits <<= 1;\n const m = fib(k);\n if (n1 >= m) {\n bits |= 1;\n n1 -= m;\n }\n }\n return bits;\n}\nconst fibencode_uint = memoize(_fibencode_uint);\n\n/** helper function estimating the size of an encoded value, used for run-length coding */\nfunction fibencsize(n: uint): uint {\n return fibencode_uint(n).toString(2).length;\n}\n\n/** Fibonacci decode a prefix-free bit pattern to recover the original uint value */\nfunction _fibdecode_uint(bits: uint): uint {\n if (!(isuint(bits) && bits >= 3)) throw new Error(`fibdecode_uint: Invalid encoded integer: ${bits.toString(2)}`)\n\n // sum the fibonacci numbers represented by the bit pattern, ignoring the MSB flag\n let n = 0;\n for(let k=2; bits > 1; k++) {\n if (bits & 0x1) n += fib(k);\n bits >>= 1;\n }\n return n-1;\n}\nconst fibdecode_uint = memoize(_fibdecode_uint);\n\n/** Fibonacci code a seq<uint> to a prefix free encoding chunked into seq<uint6> */\nfunction fibencode(vs: uint[]): uint[] {\n if (typeof vs === 'number') return fibencode([vs]);\n if (!vs.every(isuint)) throw new Error(`fibencode: Expected list of unsigned integers ${vs}`);\n const fibs = vs.map(fibencode_uint),\n seq: number[] = [];\n let bits = 0,\n k = 0,\n lead_bit = 0x1;\n while (fibs.length && k < 6) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n bits |= fibs.shift()! << k;\n while (lead_bit <= bits) {\n k++;\n lead_bit <<= 1;\n }\n while (k >= 6) {\n seq.push(bits & 0x3f);\n bits >>= 6;\n lead_bit >>= 6;\n k -= 6;\n }\n }\n if (k) seq.push(bits);\n return seq;\n}\n\n/** Decode prefix-free Fibonacci coding chunked into seq<64> by fibencode() to recover original seq<uint> */\nfunction fibdecode(seq: uint[]): uint[] {\n const vs: number[] = [];\n let bitseq = 0,\n m = 0,\n mask = 0x3,\n k = 2;\n while (seq.length) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n bitseq |= (seq.shift()! << m);\n m += 6;\n while (k <= m) {\n if ((mask & bitseq) == mask) {\n const bits = bitseq & ((1 << k) - 1),\n v = fibdecode_uint(bits);\n vs.push(v);\n bitseq >>= k;\n m -= k;\n k = 2;\n mask = 0x3;\n } else {\n k++;\n mask <<= 1;\n }\n }\n }\n return vs;\n}\n\n/** run length code seq<uint> => seq<uint> (hopefully shorter) by replacing runs of consecutive\n * values by <marker> <value> <repeat - min_repeat>, returning a new array of unsigned integer.\n * @param {Array[uint]} vs - The list of values to encode\n * @param {uint} marker - value to use as repeat token; existing values >= marker are incremented\n * @param {function} vsize - Function returning the expected size of encoding a value\n */\nfunction rlencode(vs: uint[], marker = 0, vsize = fibencsize): uint[] {\n if (!vs.every(isuint)) throw new Error(`rlencode: Expected list of unsigned integers: ${vs}`);\n if (!isuint(marker)) throw new Error(`rlencode: Expected unsigned integer marker: ${marker}`);\n\n /*\n for efficient run coding we want len(<marker><value><0>) < len(<value><value>...)\n => len(<marker><0>) < len(<value>) * (repeat - 1)\n => repeat > len(<marker><0>) / len(<value>) + 1\n */\n\n const rptlen = vsize(marker) + vsize(0);\n\n const zs: number[] = [],\n seq = vs.map(v => v >= marker ? v + 1: v);\n let prev = -1,\n repeat = 0;\n\n seq.push(-1); // dummy to make sure we flush final value(s)\n seq.forEach(v => {\n if (v == prev) {\n repeat++;\n } else {\n const prev_1 = prev > marker ? prev - 1: prev,\n min_repeat = repeat > 1 ? Math.ceil(rptlen/vsize(prev_1)) + 1: 2;\n if (repeat >= min_repeat) {\n zs.push(marker);\n zs.push(prev_1);\n zs.push(repeat - min_repeat);\n } else {\n while(repeat--) zs.push(prev);\n }\n repeat = 1;\n prev = v;\n }\n });\n return zs;\n}\n\n/** run length decode seq<uint> => seq<uint> to recover original array provided to rlencode\n * the marker and vsize function must match the original encoding\n */\nfunction rldecode(zs: uint[], marker = 0, vsize = fibencsize): uint[] {\n if (!zs.every(isuint)) throw new Error(`rldecode: Expected list of unsigned integers: ${zs}`);\n if (!isuint(marker)) throw new Error(`rldecode: Expected unsigned integer marker: ${marker}`);\n\n const rptlen = vsize(marker) + vsize(0),\n vs: number[] = [];\n\n while(zs.length) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let v = zs.shift()!;\n if (v != marker) {\n vs.push(v > marker ? v - 1: v);\n } else {\n if (zs.length < 2) throw new Error('rldecode: Malformed run definition');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n v = zs.shift()!;\n const min_repeat = Math.ceil(rptlen/vsize(v)) + 1;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let repeat = zs.shift()! + min_repeat;\n while(repeat--) vs.push(v);\n }\n }\n return vs;\n}\n\n/** map a seq<int> (or singleton int) to seq<uint> */\nconst zigzag1 = memoize((v: uint): uint => v < 0 ? ((-v) << 1) - 1: v << 1);\n\nfunction zigzag(vs: int[]): uint[] {\n if (!vs.every(Number.isInteger)) throw new Error(`zigzag: Expected list of integers: ${vs}`);\n return vs.map(zigzag1);\n}\n\n/** recover seq<int> from a zigzag()d seq<uint> */\nconst zagzig1 = memoize((v: uint): uint => v & 0x1 ? -((v + 1) >> 1): v >> 1);\n\nfunction zagzig(vs: uint[]): int[] {\n if (!vs.every(isuint)) throw new Error(`zagzig: Expected list of unsigned integers: ${vs}`);\n return vs.map(zagzig1);\n}\n\n/** combine multiple small numbers into a single result by interleaving bits\n * this is not safe for large numbers / long lists without switching to bigint\n * since JS works with signed 32-bit integers for bitwise ops\n */\nfunction ravel0_(v: uint): uint {\n v = (v | (v << 8)) & 0x00FF00FF;\n v = (v | (v << 4)) & 0x0F0F0F0F;\n v = (v | (v << 2)) & 0x33333333;\n v = (v | (v << 1)) & 0x55555555;\n return v;\n}\nconst ravel0 = memoize(ravel0_);\n\nfunction unravel0_(v: uint): uint {\n v &= 0x55555555;\n v = (v | (v >> 1)) & 0x33333333;\n v = (v | (v >> 2)) & 0x0F0F0F0F;\n v = (v | (v >> 4)) & 0x00FF00FF;\n v = (v | (v >> 8)) & 0x0000FFFF;\n return v;\n}\nconst unravel0 = memoize(unravel0_);\n\nfunction ravel2(x: uint, y: uint): uint {\n if (!(isuint(x) && isuint(y))) throw new Error(`ravel: Expected pair of unsigned int, got ${x}, ${y}`);\n return ravel0(x) | (ravel0(y) << 1);\n}\n\nfunction unravel2(z: uint): [uint, uint] {\n if (!isuint(z)) throw new Error(`unravel: Expected unsigned int: ${z}`);\n return [unravel0(z), unravel0(z >> 1)]\n}\n\nexport {\n wrap64, unwrap64,\n str2seq, seq2str,\n fletcher6,\n bitsencode, bitsdecode,\n fibencode, fibdecode,\n rlencode, rldecode,\n zigzag, zagzig,\n zigzag1, zagzig1,\n ravel2, unravel2,\n};\n","// Atari had a memory location that could be read for a byte of random noise\n// but we'll instead use a reproducible 24-bit generator\n\nimport {webcrypto} from 'node:crypto';\n\ninterface Crypto {getRandomValues: (buf: ArrayBufferView) => ArrayBufferView}\n\nconst _crypto = webcrypto ?? (window && window.crypto) as Crypto;\n\ninterface Generator {\n state: (seed?: number) => number,\n bit: () => number,\n byte: () => number,\n bits: (n: number) => number,\n}\n\nfunction lfsr24(seed?: number): Generator {\n const beforezero = 0xEF41CC; // arbitrary location to insert zero in the sequence\n\n seed ??= _crypto.getRandomValues(new Uint32Array(1))[0];\n let r: number;\n\n function bit() {\n const v = r & 0x1;\n if (r == beforezero) {\n r = 0;\n } else {\n if (r == 0) r = beforezero; // continue on\n // constant via // https://en.wikipedia.org/wiki/Linear-feedback_shift_register\n r = (r >> 1) ^ (-(r & 1) & 0xe10000);\n }\n return v;\n }\n function bits(k: number): number {\n let v = 0;\n for (let i=0; i<k; i++) v = (v << 1) | bit();\n return v;\n }\n function state(seed?: number): number {\n if (seed != null) r = seed & 0xffffff;\n return r;\n }\n state(seed);\n\n return {\n state: state,\n bit: bit,\n bits: bits,\n byte: () => bits(8),\n }\n}\n\nexport {lfsr24, type Generator};\n","import {Point, directions, memoize, DirectionKey} from './defs';\nimport {ravel2, unravel2, zigzag1, zagzig} from './codec';\n\n// the map is made up of locations, each with a lon and lat\n// grid points have integer coordinates and a unique identifier\n\ninterface GridPoint extends Point {\n lon: number;\n lat: number;\n gid: number;\n}\n\nfunction toid(lon: number, lat: number): number {\n return ravel2(zigzag1(lon), zigzag1(lat));\n}\n\nfunction byid_(gid: number): GridPoint {\n const [lon, lat] = zagzig(unravel2(gid));\n return {lon, lat, gid};\n}\nconst byid = memoize(byid_);\n\nfunction adjsbyid_(gid: number): number[] {\n const {lon, lat} = Grid.byid(gid);\n return Object.values(directions)\n .map(({dlon, dlat}) => Grid.lonlat(lon + dlon, lat + dlat).gid);\n}\nconst adjsbyid = memoize(adjsbyid_);\n\nfunction directionsFrom(p: Point, q: Point): [number, DirectionKey][] {\n // project all directions from p to q and rank them, ensuring tie breaking has no bias\n // returned pairs are like [ (q - p) . dir, key ], ordered by projection magnitude\n // if p == q an empty list is returned\n const dlat = (q.lat - p.lat),\n dlon = (q.lon - p.lon);\n if (dlat == 0 && dlon == 0) return [];\n return Object.entries(directions)\n .map(([k, d]) => <[number, DirectionKey]>[d.dlon * dlon + d.dlat * dlat, +k])\n // in case of tied dirs (which will be neighbors) pick the clockwise leader\n .sort(([a, i], [b, j]) => (b - a) || ((j - i + 4 + 2)%4) - 2);\n}\n\nfunction directionFrom(p: Point, q: Point): (DirectionKey|null) {\n // return the index of the closest cardinal direction from p to q, null if p == q\n const projections = directionsFrom(p, q);\n return projections.length ? projections[0][1]: null;\n}\n\nfunction squareSpiral(center: GridPoint, radius: number): GridPoint[] {\n // return list of the (2*radius+1)^2 locations spiraling out from loc\n // which form a square of given radius, based on a spiralpattern\n // that looks like N, E, S,S, W,W, N,N,N, E,E,E, S,S,S,S, W,W,W,W, ...\n\n let loc = center,\n dir = 0,\n i = 0,\n side = 1;\n const locs = [loc];\n\n while (++i < 2*radius+1) {\n loc = Grid.adjacent(loc, dir);\n locs.push(loc);\n if (i == side) {\n side += dir % 2;\n dir = (dir + 1) % 4;\n i = 0;\n }\n }\n return locs;\n}\n\n// hack to memoize squarespiral of radius 1 which get used a lot\nfunction squareSpira11_(gid: number): number[] {\n return squareSpiral(Grid.byid(gid), 1).map(({gid}) => gid);\n}\nconst squareSpira11 = memoize(squareSpira11_);\n\n\nfunction diamondSpiral(center: Point, radius: number, facing = DirectionKey.north): GridPoint[] {\n // return list of GridPoints within radius manhattan distance of center,\n // spiraling out from the origin starting in direction facting\n // the 0th shell has a single point, with the i-th shell having 4*i points for i>1\n // so the result has 2*r*(r+1) + 1 points\n let loc = Grid.lonlat(center.lon, center.lat);\n // the zeroth shell\n const locs = [loc];\n for (let r=1; r<=radius; r++) {\n // bump out one shell in the required direction\n loc = Grid.adjacent(loc, facing);\n // loop over the four sides of the shell\n for (let d=0; d<4; d++) {\n const d1 = (facing+d+1) % 4,\n d2 = (facing+d+2) % 4;\n for (let i=0; i<r; i++) {\n // push the point and make a diagonal step\n locs.push(loc)\n loc = Grid.adjacent(Grid.adjacent(loc, d1), d2)\n }\n }\n }\n return locs;\n}\n\nconst Grid = {\n byid: byid,\n lonlat: (lon: number, lat: number): GridPoint => byid(toid(lon, lat)),\n point: ({lon, lat}: Point): GridPoint => byid(toid(lon, lat)),\n\n adjacencies: ({gid}: GridPoint): GridPoint[] => adjsbyid(gid).map(Grid.byid),\n adjacent: ({gid}: GridPoint, d: DirectionKey): GridPoint => Grid.byid(adjsbyid(gid)[d]),\n\n // calculate the taxicab metric between two locations\n manhattanDistance: (p: Point, q: Point): number => Math.abs(p.lat - q.lat) + Math.abs(p.lon - q.lon),\n directionsFrom: directionsFrom,\n directionFrom: directionFrom,\n squareSpiral: (center: GridPoint, radius: number): GridPoint[] => {\n return (radius == 1) ? squareSpira11(center.gid).map(Grid.byid): squareSpiral(center, radius);\n },\n diamondSpiral: diamondSpiral,\n};\n\nexport {type GridPoint, Grid};","import {Point, PlayerKey} from './defs';\n/*\nThe game map is represented as binary data using one byte per square at offset 0x6500\nthe original encoding uses the high two bits to select the foreground color\nand the low six bits to choose a character from a set of 64 custom characters.\nin fact the top and bottom halves of the map use slightly different character sets and color scheme.\n\nSince not all bit patterns are used (the high two bits are nearly redundant),\nwe can store exactly the same raw binary data using a custom base64(ish) encoding\n(for north and south) and then represent the map with a human-readable string.\n\nNorth and south parts of map are encoded from 6-bit hex to ascii\nwith pipe-delimited blocks of chrs for consecutive terrain types\n\nThe full map is 48 x 41, including the impassable border.\nHowever most game logic use a lat/lon coord system\nwith (0,0) in the bottom right corner *excluding* the border.\nThus the internal map has longitudes 0-45 and latitudes 0-38.\nIhe first 25 rows (incl border) are mapped with a northern charset\nwhich mainly uses forest rather than the mountains of the southern charset\n*/\ntype City = Point & {owner: PlayerKey, points: number, label: string};\ntype MapVariant = {\n font: string, encoding: readonly [string, string], ascii: string, cities: readonly City[]\n} ;\nconst enum MapVariantKey {apx, cart}\nconst mapVariants: Record<MapVariantKey, MapVariant> = {\n [MapVariantKey.apx]: {\n font: 'apx',\n encoding: [\n ' |123456|@*0$|||,.;:|abcdefghijklmnopqrstuvwxyz|ABCDEFGHIJKLMNOPQR|{}??|~#',\n ' |123456|@*0$|||,.;:|abcdefghijklmnopqrst|ABCDEFGHIJKLMNOPQRSTUVW|{}<??|~#'\n ],\n ascii: `\n################################################\n#~~~A L~~B #\n#~~~GJ MNPONK{H #\n#~~~~GPOQ~~IH@om #\n#~~~~~IDEF{}v;f. ow nrtx #\n#~~~~~C RJj:g15 fcsl dqw nv #\n#~~~~~B LBe.h26 i nz* oskcrw #\n#~~~~~GJ Hg,i31 gcrqm 0dx #\n#~~~~~~A j43 ol g #\n#~~ID~~B* f 2 2 h btqy #\n#~~B KE}qrw 1 i nk #\n#~~A av om 0 $ nk g #\n#~~C bsx nl 36 j e #\n#~~GJ ctuk 2i412pusqm h #\n#~~~B ntk 34f nl #\n#~~I}rqsv 265 oul@ 16 e j i$ #\n#~IH ct 1431 pm i f #\n#EH 26$ .h, aty pm #\n# 135 :bw; @ h0 j #\n# 26 ;,:dy cw h #\n#x0 54 ,.:;. j g g #\n#dw 31 ;quw:,f h bsv i #\n# ay 346 ,.:;crxi cx dx f #\n# g 25,:;,.,:.dz i auqsrx j #\n# nl .,;:. ,f $f e@aqrtw #\n#ki : @g bw g bx#\n#16 ans dnmolnr f d#\n#2534 cmp cop jh #\n# 1563 ns nq blr ktmi #\n# 4315 cq dop doq ji #\n# 246 amnlr als ap kh #\n# 135 bp cr *e NC<0 #\n# 264 ds bq kh ODHPL #\n# 516 r aq dp g MI~QK #\n# 1243bs cr0 e ji B~~FR #\n# 53621aq d{C}DE<TJ~~~PL $jlonq #\n# 451523614562cp NH~~~PKUVVWASkomh f #\n# 5364142 3416 d{EI~~~~FR NH~G}DER #\n# OJ~~~~~~~GSMI~~~~~~GCS542361621#\n# B~~~~~~~~~FJ~~~~~~~~~FDES123433#\n################################################\n`,\n // M.ASM:8630 MPTS / MOSCX / MOSCY - special city victory points; updated in CITYxxx for CART\n // oddly Sevastpol is assigned points but is not coded as a city in either version of the map?\n //TODO create a variant that replaces F => @ in the bottom row of the map, and adds to city list\n cities: [\n {owner: PlayerKey.Russian, lon: 20, lat: 28, points: 20, label: 'Moscow'},\n {owner: PlayerKey.Russian, lon: 33, lat: 36, points: 10, label: 'Leningrad'},\n {owner: PlayerKey.Russian, lon: 6, lat: 15, points: 10, label: 'Stalingrad'},\n {owner: PlayerKey.Russian, lon: 12, lat: 4, points: 0, label: 'Krasnodar'}, // APX all others zero except Sevastopol\n {owner: PlayerKey.Russian, lon: 13, lat: 33, points: 0, label: 'Gorky'},\n {owner: PlayerKey.Russian, lon: 7, lat: 32, points: 0, label: 'Kazan'},\n {owner: PlayerKey.Russian, lon: 38, lat: 30, points: 0, label: 'Riga'},\n {owner: PlayerKey.Russian, lon: 24, lat: 28, points: 0, label: 'Rzhev'},\n {owner: PlayerKey.Russian, lon: 26, lat: 24, points: 0, label: 'Smolensk'},\n {owner: PlayerKey.Russian, lon: 3, lat: 24, points: 0, label: 'Kuibishev'},\n {owner: PlayerKey.Russian, lon: 33, lat: 22, points: 0, label: 'Minsk'},\n {owner: PlayerKey.Russian, lon: 15, lat: 21, points: 0, label: 'Voronezh'},\n {owner: PlayerKey.Russian, lon: 21, lat: 21, points: 0, label: 'Orel'},\n {owner: PlayerKey.Russian, lon: 20, lat: 15, points: 0, label: 'Kharkov'},\n {owner: PlayerKey.Russian, lon: 29, lat: 14, points: 0, label: 'Kiev'},\n {owner: PlayerKey.Russian, lon: 12, lat: 8, points: 0, label: 'Rostov'},\n {owner: PlayerKey.Russian, lon: 20, lat: 8, points: 0, label: 'Dnepropetrovsk'},\n {owner: PlayerKey.Russian, lon: 26, lat: 5, points: 0, label: 'Odessa'},\n {owner: PlayerKey.Russian, lon: 20, lat: 0, points: 0, label: 'Sevastopol'}, // originally 10pt then omitted from APX\n {owner: PlayerKey.German, lon: 44, lat: 19, points: 0, label: 'Warsaw'},\n ]\n },\n [MapVariantKey.cart]: {\n font: 'cart',\n encoding: [\n \" |123456|@*0$|||,.;:|abcdefghijklmnopqrstuvwxyz|ABCDEFGHIJKLMNOPQ|{}???|~#\",\n \" |123456|@*0$|||,.;:|abcdefghijklmnopqrst|ABCDEFGHIJKLMNOPQRSTUV|{}<???|~#\"\n ],\n ascii: `\n################################################\n#~~~A L~~B #\n#~~~GJ MNPONK{H #\n#~~~~GPOO~~IH0om #\n#~~~~~IDEF{}v;f. ow nrtx #\n#~~~~~C QJj:g15 fcsl dqw nv #\n#~~~~~B LBe.h26 i nz* oskcrw #\n#~~~~~GJ Hg,i31 gcrqm @dx #\n#~~~~~~A j43 ol g #\n#~~ID~~B* f 2 2 h btqy #\n#~~B KE}qrw 1 i nk #\n#~~A av om @ $ nk g #\n#~~C bsx nl 36 j e #\n#~~GJ ctuk 2i412pusqm h #\n#~~~B ntk 34f nl #\n#~~I}rqsv 265 oul@ 16 e j i* #\n#~IH ct 1431 pm i f #\n#EH 26@ .h, aty pm #\n# 135 :bw; @ h* j #\n# 26 ;,:dy cw h #\n#x@ 54 ,.:;. j g g #\n#dw 31 ;quw:,f h bsv i #\n# ay 346 ,.:;crxi cx dx f #\n# g 25,:;,.,:.dz i auqsrx j #\n# nl .,;:. ,f *f e0aqrtw #\n# i : @g bw g bx#\n#16 ans dnmolnr f d#\n#2534 cmp cop jh #\n# 1563 ns nq blr ktmi #\n# 4315 cq dop doq ji #\n# 246 amnlr als ap kh #\n# 135 bp cr *e NC<@ #\n# 264 ds bq kh ODHPL #\n# 516 r aq dp g MI~QK #\n# 1243bs cr* e ji B~~FR #\n# 53621aq d{C}DE<TJ~~~PL 0jlonq #\n# 451523614562cp NH~~~PKUVVVASkomh f #\n# 5364142 3416 d{EI~~~~FR NH~G}DER #\n# OJ~~~~~~~GSMI~~~~~~GCS542361621#\n# B~~~~~~~~~FJ~~~~~~~~~FDES123433#\n################################################\n`,\n // M.ASM:8630 MPTS / MOSCX / MOSCY - special city victory points; updated in CITYxxx for CART\n // oddly Sevastpol is assigned points but is not coded as a city in either version of the map?\n //TODO create a variant that replaces F => @ in the bottom row of the map, and adds to city list\n cities: [\n {owner: PlayerKey.Russian, lon: 20, lat: 28, points: 10, label: 'Moscow'},\n {owner: PlayerKey.Russian, lon: 33, lat: 36, points: 5, label: 'Leningrad'},\n {owner: PlayerKey.Russian, lon: 6, lat: 15, points: 5, label: 'Stalingrad'},\n {owner: PlayerKey.Russian, lon: 12, lat: 4, points: 5, label: 'Krasnodar'},\n {owner: PlayerKey.Russian, lon: 13, lat: 33, points: 5, label: 'Gorky'},\n {owner: PlayerKey.Russian, lon: 7, lat: 32, points: 5, label: 'Kazan'},\n {owner: PlayerKey.Russian, lon: 38, lat: 30, points: 2, label: 'Riga'},\n {owner: PlayerKey.Russian, lon: 24, lat: 28, points: 2, label: 'Rzhev'},\n {owner: PlayerKey.Russian, lon: 26, lat: 24, points: 2, label: 'Smolensk'},\n {owner: PlayerKey.Russian, lon: 3, lat: 24, points: 5, label: 'Kuibishev'},\n {owner: PlayerKey.Russian, lon: 33, lat: 22, points: 2, label: 'Minsk'},\n {owner: PlayerKey.Russian, lon: 15, lat: 21, points: 2, label: 'Voronezh'},\n {owner: PlayerKey.Russian, lon: 21, lat: 21, points: 2, label: 'Orel'},\n {owner: PlayerKey.Russian, lon: 20, lat: 15, points: 2, label: 'Kharkov'},\n {owner: PlayerKey.Russian, lon: 29, lat: 14, points: 2, label: 'Kiev'},\n {owner: PlayerKey.Russian, lon: 12, lat: 8, points: 2, label: 'Rostov'},\n {owner: PlayerKey.Russian, lon: 20, lat: 8, points: 2, label: 'Dnepropetrovsk'},\n {owner: PlayerKey.Russian, lon: 26, lat: 5, points: 2, label: 'Odessa'},\n {owner: PlayerKey.Russian, lon: 20, lat: 0, points: 0, label: 'Sevastopol'}, // originally 10pt then omitted from APX\n {owner: PlayerKey.German, lon: 44, lat: 19, points: 5, label: 'Warsaw'},\n ]\n },\n } as const;\n\n// D.ASM:5500 BHX1 .BYTE ... / BHY1 / BHX2 / BHY2\n// there are 11 impassable square-sides\n// the original game stores 22 sets of (x1,y1),(x2,y2) coordinates\n// to enumerate the to/from coordinates in both senses\n// but we can reduce from 88 to 22 bytes by storing a list of\n// squares you can't move north from (or south to), and likewise west from (or east to)\nconst blocked: readonly [ readonly Point[], readonly Point[]] = [\n // can't move north from here (or south into here)\n [\n {lon: 40, lat: 35},\n {lon: 39, lat: 35},\n {lon: 38, lat: 35},\n {lon: 35, lat: 36},\n {lon: 34, lat: 36},\n {lon: 22, lat: 3},\n {lon: 15, lat: 6},\n {lon: 14, lat: 7},\n {lon: 19, lat: 3}\n ],\n // can't move west from here (or east into here)\n [\n {lon: 35, lat: 33},\n {lon: 14, lat: 7},\n ]\n ] as const;\n\nexport {mapVariants, MapVariantKey, blocked};\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import {OobVariantKey} from './oob-data';\nimport {MapVariantKey} from './map-data';\nimport { PlayerKey } from './defs';\n\n// cartridge offers selection of scenarios which modify various parameters:\ntype Scenario = {\n label: string, // name for this scenario\n map: MapVariantKey, // which map variant is used\n oob: OobVariantKey, // which OoB is used\n start: string, // date of start turn as 'yyyy/mm/dd'\n ncity: number, // number of scored cities (excl Warsaw which never scores)\n mdmg: number, // mstrng damage from successful attack\n cdmg: number, // cstrng damage from successful attack\n cadj: number, // base adjustment to german combat strength\n // index of first ineligbile unit, e.g. 0x2 means we use the first 2 ids\n nunit: readonly [number, number],\n endturn: number, // turn (week) number after which scenario ends\n scoring: {\n win: number, // score required to win from player 0 pov\n location?: boolean, // count score for east-west location?\n // whether and how to score strength by player;\n // 'current' means 1pt per 128 current and future cstrng, 'losses' is -1pt per 128 initial mstrng lost\n strength?: readonly ['current'|'losses'|null, 'current'|'losses'|null],\n adjust?: number, // constant adjustment from player 0 pov\n },\n surprised?: PlayerKey, // which player, if any, doesn't move the first turn\n skipsupply?: boolean, // whether to skip supply check\n simplebreak?: boolean, // whether to use simplied break after combat check\n nozoc?: boolean, // whether to ignore ZoC\n defmod?: number, // additional shift modifier for defender strength\n // original game stored fog as mask, e.g. 0xC0 is 1100 0000 so fog = 6, 0x80 => 7\n fog?: number, // number of randomized lsbits for far-off enemy strength\n mvmode?: boolean, // true if scenario allows choice of move mode\n repl?: readonly [number, number], // mstrng replacements if in supply by PlayerKey\n control?: readonly string[], // list of cities whose control is flipped from default\n};\nconst enum ScenarioKey {apx, learner, beginner, intermediate, advanced, expert41, expert42}\nconst scenarios: Record<ScenarioKey, Scenario> = {\n [ScenarioKey.apx]: {\n label: 'APX MODE', map: MapVariantKey.apx, oob: OobVariantKey.apx, start: '1941/6/22',\n //TODO fix me\n ncity: 18, mdmg: 1, cdmg: 5, cadj: 0, nunit: [0x37, 0x9f], endturn: 44,\n scoring: {win: 255, location: true},\n surprised: PlayerKey.Russian, repl: [0, 2]\n },\n [ScenarioKey.learner]: {\n label: 'LEARNER', map: MapVariantKey.cart, oob: OobVariantKey.cart41, start: '1941/6/22',\n ncity: 1, mdmg: 4, cdmg: 12, cadj: 255, nunit: [0x2, 0x31], endturn: 14,\n scoring: {win: 5, strength: [null, 'losses']},\n surprised: PlayerKey.Russian, skipsupply: true, nozoc: true, simplebreak: true\n },\n [ScenarioKey.beginner]: {\n label: 'BEGINNER', map: MapVariantKey.cart, oob: OobVariantKey.cart41, start: '1941/6/22',\n ncity: 1, mdmg: 4, cdmg: 12, cadj: 150, nunit: [0x12, 0x50], endturn: 14,\n scoring: {win: 25, strength: [null, 'losses']},\n surprised: PlayerKey.Russian, skipsupply: true, nozoc: true, simplebreak: true\n },\n [ScenarioKey.intermediate]: {\n label: 'INTERMED', map: MapVariantKey.cart, oob: OobVariantKey.cart41, start: '1941/6/22',\n ncity: 3, mdmg: 2, cdmg: 8, cadj: 75, nunit: [0x1f, 0x72], endturn: 40,\n surprised: PlayerKey.Russian, scoring: {win: 40, strength: ['losses', 'losses']},\n },\n [ScenarioKey.advanced]: {\n label: 'ADVANCED', map: MapVariantKey.cart, oob: OobVariantKey.cart41, start: '1941/6/22',\n ncity: 18, mdmg: 1, cdmg: 5, cadj: 25, nunit: [0x2b, 0x90], endturn: 40,\n scoring: {win: 80, strength: ['losses', 'losses']},\n surprised: PlayerKey.Russian, fog: 6,\n },\n [ScenarioKey.expert41]: {\n label: 'EXPERT41', map: MapVariantKey.cart, oob: OobVariantKey.cart41, start: '1941/6/22',\n ncity: 18, mdmg: 1, cdmg: 4, cadj: 0, nunit: [0x30, 0xa8], endturn: 44,\n scoring: {win: 255, strength: ['losses', 'current']},\n surprised: PlayerKey.Russian, mvmode: true, fog: 7, defmod: 1,\n },\n [ScenarioKey.expert42]: {\n //TODO arrival turns for '42 scenario seem to be calculated in cartridge.asm:3709\n label: 'EXPERT42', map: MapVariantKey.cart, oob: OobVariantKey.cart42, start: '1942/5/24', // +48 weeks\n ncity: 18, mdmg: 1, cdmg: 4, cadj: 0, nunit: [0x30, 0xa8], endturn: 44,\n // adjust by 9 here because cart measures losses wrt to 1941 start value\n scoring: {win: 255, strength: ['losses', 'current'], adjust: -9},\n mvmode: true, fog: 7, defmod: 1,\n control: ['Riga', 'Rzhev', 'Smolensk', 'Minsk', 'Orel', 'Kharkov', 'Kiev', 'Dnepropetrovsk', 'Odessa'] as const\n },\n} as const;\n\nexport {scenarios, ScenarioKey};\n","//TODO these represent deviations from the original implementation\n// in general false reflects the original APX/cartridge condition\n// the values here show my current choices, but aren't actually configurable in code yet\nconst options = {\n colorPalette: 'WikiNTSC', // 'Atari800MacXnewStellaNTSC', 'Atari800MacXz26NTSC' are also playable\n astarPathFinding: true,\n reduceInitialFogInContact: true, // initial fog reduced for units in contact at scenario start\n mapIncludesSevastopol: true, // in APX it looks like it initially scored 10pts but later removed\n disperseEliminatedUnits: true, // whether eliminated units disperse nearby (as in cartridge)\n defenderFirstStrike: true, // whether defender can break attacker and prevent attack\n\n // hard-wired settings (these config options aren't referenced)\n mapIncludeSevastopol: true,\n germanReinforcementsMoveOnArrival: true,\n russianReinforcementsMoveOnArrival: false,\n moreRandomSupplyAndRetreat: true, // randomize N/S check in retreat and supply vs fixed order\n shuffleUnitInitiative: false, // vs reverse unit index order-processing preferring Russians, note [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) sort full list of 256?\n shuffleThinkingOrder: false,\n} as const;\n\nexport {options}","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport {\n type Flag, type Point,\n directions, DirectionKey,\n terraintypes, TerrainKey,\n waterstate, WaterStateKey,\n monthdata,\n PlayerKey,\n clamp,\n memoize,\n} from './defs';\nimport {Grid, type GridPoint} from './grid';\nimport {mapVariants, blocked} from './map-data';\nimport {scenarios} from './scenarios';\n\nimport type {Game} from './game';\nimport {options} from '../config';\n\ntype Path = {cost: number, orders: DirectionKey[]};\n\ntype MapEvent = 'citycontrol';\n\ninterface LocationData {\n icon: number,\n terrain: TerrainKey,\n alt: Flag\n}\n\ninterface MapPoint extends GridPoint, LocationData {\n cityid?: number;\n unitid?: number;\n}\n\n// mapboard constructor, used as a container of MapPoints\nclass Mapboard {\n locations: MapPoint[][];\n cities;\n font;\n #game; //TODO only wants .month, .emit, .rand\n #maxlon;\n #maxlat;\n #icelat = 39; // via M.ASM:8600 PSXVAL initial value is 0x27\n #validlocs: Map<number, MapPoint> = new Map();\n\n constructor(game: Game, memento?: number[]) {\n const\n scenario = scenarios[game.scenario],\n variant = mapVariants[scenario.map],\n ncity = scenario.ncity,\n mapencoding = variant.encoding.map((enc, i) => {\n // convert the encoding table into a lookup of char => [icon, terraintype, alt-flag]\n const lookup: {[key: string]: LocationData} = {};\n let ch = 0;\n enc.split('|').forEach((s, t) =>\n s.split('').forEach(c => {\n const alt: Flag = ((t == 1 && i == 0) || ch == 0x40) ? 1 : 0;\n if (ch==0x40) ch--;\n lookup[c] = {\n icon: i * 0x40 + ch++,\n terrain: t as TerrainKey,\n alt: alt\n };\n })\n );\n return lookup;\n });\n\n let raw = variant.ascii;\n if (options.mapIncludesSevastopol) raw = raw.slice().replace('~~FJ~~', '~~$J~~');\n\n // decode the map into a 2-d array of rows x cols of {lon: , lat:, icon:, terrain:, alt:}\n const mapdata = raw.split(/\\n/).slice(1,-1).map(\n (row, i) =>\n row.split('').map(\n c => Object.assign({}, mapencoding[i <= 25 ? 0: 1][c])\n )\n );\n\n this.font = variant.font;\n\n // excluding the impassable border valid is 0..maxlon-1, 0..maxlat-1\n this.#maxlon = mapdata[0].length-2;\n this.#maxlat = mapdata.length-2;\n\n this.#game = game;\n this.locations = mapdata.map(\n (row, i) => row.map(\n (data, j) => {\n const lon: number = this.#maxlon - j,\n lat = this.#maxlat - i,\n pt = Grid.lonlat(lon, lat),\n loc = {...pt, ...data};\n if (pt.lat >= 0 && pt.lat < this.#maxlat && pt.lon >= 0 && pt.lon < this.#maxlon) {\n this.#validlocs.set(pt.gid, loc);\n }\n return loc\n }\n )\n );\n\n this.cities = variant.cities\n .filter(c => options.mapIncludesSevastopol || c.label != 'Sevastopol')\n .map(c => ({...c}));\n this.cities.forEach((city, i) => {\n city.points = i < ncity ? (city.points ?? 0): 0;\n const loc = this.locationOf(Grid.point(city));\n if (loc.terrain != TerrainKey.city)\n throw new Error(`Mapboard: city at (${loc.lon}, ${loc.lat}) missing city terrain`);\n loc.cityid = i;\n if (scenario.control && scenario.control.includes(city.label)) {\n city.owner = 1 - city.owner;\n }\n });\n\n // verify each city terrain has a cityid\n const missing = this.locations.map(\n row => row.filter(\n loc => loc.terrain == TerrainKey.city && typeof loc.cityid === 'undefined'\n )).flat();\n if (missing.length > 0)\n throw new Error(`Mapboard: city terrain missing city details, e.g. ${this.describe(missing[0])}`);\n // verify that any control cities exist\n if (scenario.control) {\n const labels = this.cities.map(c => c.label),\n diff = scenario.control.filter(label => !labels.includes(label));\n if (diff.length > 0)\n throw new Error(`Mapboard: scenario.control has unknown cities ${diff}`);\n }\n if (memento) {\n if (memento.length < variant.cities.length + 1)\n throw new Error(\"Mapboard: malformed save data\");\n this.#freezeThaw(WaterStateKey.freeze, memento.shift()!);\n this.cities.forEach((c, i) => {\n // skip the control flag for Sevastopol if we're not using it\n if (!options.mapIncludesSevastopol && variant.cities[i].label == 'Sevastopol') {\n memento.shift()!;\n }\n c.owner = memento.shift()!;\n });\n }\n }\n get memento(): number[] {\n const\n scenario = scenarios[this.#game.scenario],\n variant = mapVariants[scenario.map],\n control = this.cities.map(c => c.owner);\n if (!options.mapIncludesSevastopol) {\n // always include a control flag for Sevastopol so config doesn't change save format\n const i = variant.cities.findIndex(c => c.label == 'Sevastopol');\n control.splice(i, 0, variant.cities[i].owner);\n }\n return ([] as number[]).concat([this.#icelat],control);\n }\n nextTurn(startOrResume = false) {\n const mdata = monthdata[this.#game.month];\n\n //TODO :grimace: update the tree color in place in the terrain data\n terraintypes[TerrainKey.mountain_forest].altcolor = mdata.trees;\n\n if (!startOrResume && mdata.water != null) this.#freezeThaw(mdata.water);\n }\n get extent() {\n // map dimension including impassable boundary\n return {width: this.locations[0].length, height: this.locations.length}\n }\n get bbox() {\n // bounding box for valid map area\n return {\n [DirectionKey.north]: this.#maxlat-1,\n [DirectionKey.south]: 0,\n [DirectionKey.west]: this.#maxlon-1,\n [DirectionKey.east]: 0,\n }\n }\n xy({lon, lat}: Point) {\n // return an x, y indexed from top, left rather than lon, lat indexed from bottom, right\n return {x: this.#maxlon - lon, y: this.#maxlat - lat}\n }\n describe(loc: MapPoint, debug = false) {\n const city = loc.cityid != null ? this.cities[loc.cityid] : undefined,\n label = city\n ? ` ${city.label} (${city.points ?? 0})`\n : (terraintypes[loc.terrain].label + (loc.alt ? \"-alt\": \"\")),\n unit = loc.unitid != null ? this.#game.oob.at(loc.unitid).describe(debug): \"\";\n return `[${loc.gid}] ${label}\\nlon ${loc.lon}, lat ${loc.lat}\\n\\n${unit}`.trim()\n }\n valid(pt: GridPoint) {\n return this.#validlocs.has(pt.gid);\n }\n locationOf(pt: GridPoint): MapPoint {\n // nb throws for impassable boundary points\n const loc = this.#validlocs.get(pt.gid);\n if (loc == null)\n throw new Error(`MapBoard.locationOf: invalid point ${pt.lon}, ${pt.lat}`);\n return loc;\n }\n boundaryDistance(pt: Point, dir: DirectionKey): number {\n switch (dir) {\n case DirectionKey.north: return this.#maxlat - 1 - pt.lat;\n case DirectionKey.south: return pt.lat;\n case DirectionKey.east: return pt.lon;\n case DirectionKey.west: return this.#maxlon - 1 - pt.lon;\n }\n }\n #neighborids_(gid: number): [number?, number?, number?, number?] {\n const pt = this.#validlocs.get(gid);\n if (pt == null) return [undefined, undefined, undefined, undefined];\n\n return Grid.adjacencies(pt).map((q, i) => {\n const nbr = this.#validlocs.get(q.gid),\n dir = +i as DirectionKey;\n if (nbr == null) return undefined;\n const legal = (\n nbr.terrain != TerrainKey.impassable\n && !(\n (dir == DirectionKey.north || dir == DirectionKey.south)\n ? blocked[0].find(d => d.lon == pt.lon && d.lat == (dir == DirectionKey.north ? pt.lat : nbr.lat))\n : blocked[1].find(d => d.lon == (dir == DirectionKey.west ? pt.lon : nbr.lon) && d.lat == pt.lat)\n )\n );\n return legal ? nbr.gid: null;\n }) as [number?, number?, number?, number?];\n }\n // hack to memoize class method. probably a better way to do it?\n #neighborids = memoize(\n (gid: number): [number?, number?, number?, number?] => this.#neighborids_(gid)\n )\n neighborsOf({gid}: GridPoint): [MapPoint?, MapPoint?, MapPoint?, MapPoint?] {\n return this.#neighborids(gid)\n .map(v => v == null ? v : this.#validlocs.get(v)) as\n [MapPoint?, MapPoint?, MapPoint?, MapPoint?];\n }\n neighborOf({gid}: GridPoint, dir: DirectionKey): MapPoint | undefined {\n const nbrid = this.#neighborids(gid)[dir];\n return nbrid == null ? undefined : this.#validlocs.get(nbrid);\n }\n #freezeThaw(w: WaterStateKey, newlat?: number) {\n // move ice by freeze/thaw rivers and swamps, where w is Water.freeze or Water.thaw\n // ICELAT -= [7,14] incl]; clamp 1-39 incl\n // small bug in APX code? freeze chrs $0B - $29 (exclusive, seems like it could freeze Kerch straight?)\n const state = waterstate[w],\n other = waterstate[1-w as WaterStateKey],\n oldlat = this.#icelat,\n dlat = directions[state.dir].dlat;\n\n if (newlat != null) {\n // initial setup where we freeze to saved value\n this.#icelat = newlat;\n } else {\n const change = this.#game.rand.bits(3) + 7;\n this.#icelat = clamp(oldlat + dlat * change, 1, this.#maxlat);\n }\n\n const skip = (w == WaterStateKey.freeze) ? oldlat: this.#icelat; // for freeze skip old line, for thaw skip new new\n for (let i = oldlat; i != this.#icelat + dlat; i += dlat) {\n if (i == skip) continue;\n this.locations[this.#maxlat - i].forEach(d => {\n const k = other.terrain.indexOf(d.terrain);\n if (k != -1) d.terrain = state.terrain[k];\n });\n }\n }\n occupy(loc: MapPoint, player: PlayerKey) {\n if (loc.cityid != null) {\n const c = this.cities[loc.cityid];\n if (c.owner != player) {\n c.owner = player;\n this.#game.emit('map', 'citycontrol', loc);\n }\n }\n }\n directPath(p: GridPoint, q: GridPoint, costs?: number[]): Path {\n /*\n implements a variation of Bresenham's algorith to get direct path from p to q\n returns the list of directions to step from p to q, along with the terrain cost\n similar to the original path algorithm described in the APX notes\n\n The straight line can be described by the equation A x + B y + C = 0 where\n A = (y1 - y0), B = -(x1 - x0) and C = x1 y0 - x0 y1. (Here x is lon, y is lat)\n To follow the line most closely using grid point x*, y* we keep the error E = A x* + B y* + C\n as close to zero as possible.\n Taking a step in direction dx, dy will change E by A dx + B dy\n so we just keep choosing the step that moves E back towards zero.\n */\n\n let loc = this.locationOf(p);\n const goal = this.locationOf(q);\n if (loc.gid == goal.gid) return {cost: 0, orders: []};\n\n const\n A = q.lat - p.lat,\n B = - (q.lon - p.lon),\n // C = q.lon * p.lat - q.lat * p.lon,\n projections = Grid.directionsFrom(p, q),\n i = projections[0][1], j = projections[1][1], // best two directinoe\n s = directions[i], t = directions[j],\n ds = A * s.dlon + B * s.dlat,\n dt = A * t.dlon + B * t.dlat;\n\n let err = 0,\n cost = 0;\n const orders: number[] = [];\n\n while (loc.gid != goal.gid) {\n const [k, de] = Math.abs(err + ds) < Math.abs(err + dt) ? [i, ds]: [j, dt];\n err += de;\n orders.push(k);\n //NB. not validating that we can actually take this path\n loc = this.locationOf(Grid.adjacent(loc, k));\n cost += costs ? costs[loc.terrain]: 1;\n }\n\n return {cost, orders}\n }\n bestPath(p: GridPoint, q: GridPoint, costs: number[]): Path {\n // implements A* shortest path, e.g. see https://www.redblobgames.com/pathfinding/a-star/introduction.html\n // returns {cost: , orders: []} where cost is the movement cost (ticks), and orders is a seq of dir indices\n // or null if goal is unreachable\n const minCost = Math.min(...costs),\n _head = -1;\n type FrontierPoint = {id: number, est: number};\n type Step = {dir: DirectionKey | null, cost: number};\n let src = this.locationOf(p);\n const goal = this.locationOf(q),\n // linked list of points to search next, ordered by estimated total cost via this point\n frontier = new Map<number, FrontierPoint>([[_head, {id: src.gid, est: 0}]]),\n // dir arrived from and cost from start to here\n found = new Map<number, Step>([[src.gid, {dir: null, cost: 0}]]);\n\n while (frontier.has(_head)) {\n const {id: next} = frontier.get(_head)!;\n src = this.locationOf(Grid.byid(next));\n if (src.gid == goal.gid) break;\n if (frontier.has(next)) {\n frontier.set(_head, frontier.get(next)!);\n frontier.delete(next);\n } else {\n frontier.delete(_head);\n }\n\n this.neighborsOf(src).forEach((dst, i) => {\n if (!dst) return;\n const d = +i as DirectionKey,\n cost = found.get(src.gid)!.cost + costs[dst.terrain];\n if (!found.has(dst.gid)) { // with consistent estimate we always find best first\n found.set(dst.gid, {dir: d, cost});\n const est = cost + minCost * Grid.manhattanDistance(src, dst);\n let tail = _head;\n // insert point in linked list before tail to maintain asc sort by est\n while (frontier.has(tail)) {\n const {id: _next, est: _est} = frontier.get(tail)!;\n if (est <= _est) break;\n tail = _next;\n }\n if (frontier.has(tail)) {\n frontier.set(dst.gid, frontier.get(tail)!);\n }\n frontier.set(tail, {id: dst.gid, est: est})\n }\n });\n }\n if (src.gid != goal.gid)\n throw new Error(`MapBoard.bestPath: no path from ${p} to ${q}`)\n\n const orders: number[] = [];\n let pt: GridPoint = goal;\n for(;;) {\n const dir = found.get(pt.gid)!.dir;\n if (dir == null) break;\n orders.unshift(dir);\n pt = Grid.adjacent(pt, (dir + 2) % 4); // walk back in reverse direction\n }\n return {cost: found.get(goal.gid)!.cost, orders: orders}\n }\n reach(src: GridPoint, range: number, costs: number[]) {\n // find all squares accessible to unit within range, ignoring other units, zoc\n // returns a map of point ids => range\n let cost = 0;\n const start = this.locationOf(src),\n locs: {[key: number]: number} = {[start.gid]: 0};\n\n while (cost < range) {\n Object.entries(locs).filter(([ ,v]) => v == cost).forEach(([k, ]) => {\n const src = Grid.byid(+k);\n this.neighborsOf(src).forEach(dst => {\n if (!dst) return;\n const curr = dst.gid in locs ? locs[dst.gid] : 255;\n if (curr <= cost) return;\n const c = cost + costs[dst.terrain];\n if (c <= range && c < curr) locs[dst.gid] = c;\n });\n });\n cost++;\n }\n return locs;\n }\n}\n\nexport {MapPoint, Mapboard, Path, type MapEvent};\n","// apx order-of-battle table with 159 units (55 german + 104 russian) comes from D.ASM:0x5400\n// in the original game each column is stored separately,\n// we've transposed into a list of rows which we map to unit objects\n// note cartridge has different unit counts\nconst enum OobVariantKey {apx, cart41, cart42}\ntype OobData = readonly (readonly number[])[];\nconst oobVariants: Record<OobVariantKey, OobData> = {\n [OobVariantKey.apx]: [\n // CORPSX, CORPSY, MSTRNG, SWAP, ARRIVE, CORPT, CORPNO\n // German\n [0, 0, 0, 0, 255, 0, 0],\n [40, 20, 203, 126, 0, 3, 24],\n [40, 19, 205, 126, 255, 3, 39],\n [40, 18, 192, 126, 0, 3, 46],\n [40, 17, 199, 126, 0, 3, 47],\n [40, 16, 184, 126, 0, 3, 57],\n [41, 20, 136, 125, 0, 0, 5],\n [40, 19, 127, 125, 0, 0, 6],\n [41, 18, 150, 125, 0, 0, 7],\n [41, 17, 129, 125, 0, 0, 8],\n [41, 16, 136, 125, 0, 0, 9],\n [42, 20, 109, 125, 255, 0, 12],\n [42, 19, 72, 125, 255, 0, 13],\n [42, 18, 70, 125, 255, 0, 20],\n [42, 17, 81, 125, 255, 0, 42],\n [43, 19, 131, 125, 255, 0, 43],\n [43, 18, 102, 125, 255, 0, 53],\n [43, 17, 53, 125, 255, 64, 3],\n [41, 23, 198, 126, 0, 3, 41],\n [40, 22, 194, 126, 0, 3, 56],\n [40, 21, 129, 125, 0, 0, 1],\n [41, 21, 123, 125, 0, 0, 2],\n [41, 22, 101, 125, 0, 0, 10],\n [42, 22, 104, 125, 0, 0, 26],\n [42, 23, 112, 125, 0, 0, 28],\n [42, 24, 120, 125, 0, 0, 38],\n [40, 15, 202, 126, 0, 3, 3],\n [41, 14, 195, 126, 0, 3, 14],\n [42, 13, 191, 126, 0, 3, 48],\n [41, 15, 72, 126, 255, 3, 52],\n [42, 14, 140, 125, 0, 0, 49],\n [42, 12, 142, 125, 0, 0, 4],\n [43, 13, 119, 125, 0, 0, 17],\n [41, 15, 111, 125, 0, 0, 29],\n [42, 16, 122, 125, 255, 0, 44],\n [43, 16, 77, 125, 255, 0, 55],\n [30, 2, 97, 125, 0, 48, 1],\n [30, 3, 96, 125, 0, 48, 2],\n [31, 4, 92, 125, 0, 48, 4],\n [33, 6, 125, 125, 0, 0, 11],\n [35, 7, 131, 125, 0, 0, 30],\n [37, 8, 106, 125, 0, 0, 54],\n [35, 38, 112, 125, 0, 32, 2],\n [36, 37, 104, 125, 0, 32, 4],\n [36, 38, 101, 125, 255, 32, 6],\n [45, 20, 210, 126, 2, 3, 40],\n [45, 15, 97, 125, 255, 0, 27],\n [38, 8, 98, 126, 2, 83, 1],\n [45, 16, 95, 125, 5, 0, 23],\n [31, 1, 52, 125, 6, 48, 5],\n [45, 20, 98, 125, 9, 0, 34],\n [45, 19, 96, 125, 10, 0, 35],\n [32, 1, 55, 125, 11, 64, 4],\n [45, 17, 104, 125, 20, 0, 51],\n [45, 18, 101, 126, 24, 7, 50],\n // Russian\n [29, 32, 100, 253, 4, 4, 7],\n [27, 31, 103, 253, 5, 4, 11],\n [24, 38, 110, 253, 7, 0, 41],\n [23, 38, 101, 253, 9, 0, 42],\n [20, 38, 92, 253, 11, 0, 43],\n [15, 38, 103, 253, 13, 0, 44],\n [0, 20, 105, 253, 7, 0, 45],\n [0, 8, 107, 253, 12, 0, 46],\n [0, 18, 111, 253, 8, 0, 47],\n [0, 10, 88, 253, 10, 0, 48],\n [0, 14, 117, 254, 10, 1, 9],\n [0, 33, 84, 254, 14, 1, 13],\n [0, 11, 109, 254, 15, 1, 14],\n [0, 15, 89, 254, 16, 1, 15],\n [0, 20, 105, 254, 18, 1, 16],\n [0, 10, 93, 254, 7, 2, 7],\n [21, 28, 62, 254, 0, 1, 2],\n [21, 27, 104, 253, 0, 0, 19],\n [30, 14, 101, 253, 0, 0, 18],\n [30, 13, 67, 254, 0, 2, 1],\n [39, 28, 104, 253, 0, 0, 27],\n [38, 28, 84, 254, 0, 1, 10],\n [23, 31, 127, 253, 0, 0, 22],\n [19, 24, 112, 253, 0, 0, 21],\n [34, 22, 111, 253, 0, 0, 13],\n [34, 21, 91, 254, 0, 1, 6],\n [31, 34, 79, 253, 0, 4, 9],\n [27, 6, 69, 253, 0, 0, 2],\n [33, 37, 108, 253, 0, 4, 1],\n [41, 24, 118, 253, 0, 0, 8],\n [40, 23, 137, 253, 0, 0, 11],\n [39, 23, 70, 254, 0, 1, 1],\n [42, 25, 85, 254, 0, 1, 7],\n [39, 20, 130, 253, 0, 0, 3],\n [39, 22, 91, 253, 0, 0, 4],\n [39, 18, 131, 253, 0, 0, 10],\n [39, 17, 71, 254, 0, 1, 5],\n [39, 21, 86, 254, 0, 1, 8],\n [37, 20, 75, 254, 0, 2, 3],\n [39, 19, 90, 254, 0, 2, 6],\n [39, 16, 123, 253, 0, 0, 5],\n [39, 15, 124, 253, 0, 0, 6],\n [40, 14, 151, 253, 0, 0, 12],\n [41, 13, 128, 253, 0, 0, 26],\n [41, 12, 88, 254, 0, 1, 3],\n [39, 11, 77, 254, 0, 1, 4],\n [36, 9, 79, 254, 0, 1, 11],\n [34, 8, 80, 254, 0, 2, 5],\n [32, 6, 126, 253, 0, 0, 9],\n [35, 9, 79, 254, 0, 1, 12],\n [30, 4, 91, 254, 0, 2, 4],\n [28, 2, 84, 254, 0, 2, 2],\n [25, 6, 72, 253, 1, 0, 7],\n [29, 14, 86, 253, 1, 4, 2],\n [32, 22, 76, 253, 1, 0, 14],\n [33, 36, 99, 253, 1, 4, 4],\n [26, 23, 67, 253, 1, 0, 15],\n [21, 8, 78, 253, 2, 0, 16],\n [29, 33, 121, 253, 2, 0, 20],\n [0, 28, 114, 253, 2, 0, 6],\n [28, 30, 105, 253, 3, 0, 24],\n [21, 20, 122, 253, 3, 0, 40],\n [21, 28, 127, 253, 4, 0, 29],\n [21, 33, 129, 253, 4, 0, 30],\n [20, 27, 105, 253, 5, 0, 31],\n [20, 30, 111, 253, 5, 0, 32],\n [12, 8, 112, 253, 6, 0, 33],\n [0, 10, 127, 253, 6, 0, 37],\n [0, 32, 119, 253, 7, 0, 43],\n [0, 11, 89, 253, 8, 0, 49],\n [0, 25, 108, 253, 8, 0, 50],\n [0, 12, 113, 253, 8, 0, 52],\n [0, 23, 105, 253, 9, 0, 54],\n [0, 13, 94, 253, 9, 0, 55],\n [21, 29, 103, 254, 5, 114, 1],\n [25, 30, 97, 253, 5, 0, 34],\n [0, 31, 108, 253, 2, 112, 1],\n [0, 15, 110, 253, 9, 112, 2],\n [0, 27, 111, 253, 10, 112, 3],\n [0, 17, 96, 253, 10, 112, 4],\n [0, 25, 109, 253, 6, 0, 39],\n [0, 11, 112, 253, 11, 0, 59],\n [0, 23, 95, 253, 5, 0, 60],\n [0, 19, 93, 253, 17, 0, 61],\n [0, 21, 114, 254, 2, 114, 2],\n [0, 33, 103, 254, 11, 1, 1],\n [0, 28, 107, 254, 20, 113, 1],\n [0, 13, 105, 253, 21, 112, 5],\n [0, 26, 92, 254, 22, 1, 2],\n [0, 10, 109, 253, 23, 112, 6],\n [0, 29, 101, 254, 24, 1, 3],\n [0, 35, 106, 254, 26, 1, 4],\n [0, 27, 95, 253, 28, 0, 38],\n [0, 15, 99, 254, 30, 0, 36],\n [38, 30, 101, 253, 2, 0, 35],\n [21, 22, 118, 253, 3, 0, 28],\n [12, 8, 106, 253, 3, 0, 25],\n [20, 13, 112, 253, 3, 0, 23],\n [21, 14, 104, 253, 3, 0, 17],\n [20, 28, 185, 253, 6, 4, 8],\n [15, 3, 108, 253, 6, 4, 10],\n [21, 3, 94, 253, 4, 4, 3],\n [20, 3, 102, 253, 4, 4, 5],\n [19, 2, 98, 253, 4, 4, 6],\n ],\n [OobVariantKey.cart41]: [\n // [\"CORPSX\", \"CORPSY\", \"MSTRNG\", \"ARRIVE\", \"CORPT\", \"CORPNO\"]\n [0, 0, 0, 255, 0, 0],\n [40, 20, 223, 0, 4, 24],\n [40, 18, 192, 0, 4, 46],\n [40, 17, 199, 0, 4, 47],\n [40, 16, 184, 0, 4, 57],\n [41, 20, 136, 0, 0, 5],\n [40, 19, 127, 0, 0, 6],\n [41, 18, 150, 0, 0, 7],\n [41, 17, 129, 0, 0, 8],\n [41, 16, 136, 0, 0, 9],\n [41, 23, 198, 0, 4, 41],\n [40, 22, 194, 0, 4, 56],\n [40, 21, 129, 0, 0, 1],\n [41, 21, 123, 0, 0, 2],\n [41, 22, 101, 0, 0, 10],\n [42, 22, 104, 0, 0, 26],\n [42, 23, 112, 0, 0, 28],\n [42, 24, 120, 0, 0, 38],\n [40, 15, 202, 0, 4, 3],\n [41, 14, 195, 0, 4, 14],\n [42, 13, 191, 0, 4, 48],\n [42, 14, 140, 0, 0, 49],\n [42, 12, 142, 0, 0, 4],\n [43, 13, 119, 0, 0, 17],\n [41, 15, 111, 0, 0, 29],\n [30, 2, 97, 0, 48, 1],\n [30, 3, 96, 0, 48, 2],\n [31, 4, 92, 0, 48, 4],\n [33, 6, 125, 0, 0, 11],\n [35, 7, 131, 0, 0, 30],\n [37, 8, 106, 0, 0, 54],\n [35, 38, 112, 0, 32, 2],\n [36, 37, 104, 0, 32, 4],\n [45, 20, 210, 2, 4, 40],\n [38, 8, 98, 3, 84, 1],\n [45, 15, 97, 4, 0, 27],\n [45, 16, 95, 5, 0, 23],\n [31, 1, 52, 6, 48, 5],\n [45, 17, 97, 7, 0, 12],\n [45, 18, 109, 8, 0, 13],\n [45, 20, 98, 9, 0, 34],\n [45, 19, 96, 10, 0, 35],\n [32, 1, 55, 11, 64, 4],\n [44, 20, 219, 0, 3, 1],\n [44, 18, 183, 0, 3, 2],\n [44, 17, 206, 0, 3, 3],\n [44, 16, 237, 0, 3, 4],\n [44, 14, 191, 0, 3, 5],\n // Russian starting offset +48 hex #$3034\n [20, 28, 185, 0, 129, 1],\n [21, 28, 62, 0, 133, 2],\n [21, 27, 104, 0, 128, 19],\n [30, 14, 101, 0, 128, 18],\n [30, 13, 67, 0, 134, 1],\n [39, 28, 104, 0, 128, 27],\n [38, 28, 84, 0, 133, 10],\n [23, 31, 127, 0, 128, 22],\n [19, 24, 112, 0, 128, 21],\n [34, 22, 111, 0, 128, 13],\n [34, 21, 91, 0, 133, 6],\n [31, 34, 79, 0, 129, 9],\n [41, 24, 118, 0, 128, 8],\n [40, 23, 137, 0, 128, 11],\n [39, 23, 70, 0, 133, 1],\n [42, 25, 85, 0, 133, 7],\n [39, 20, 130, 0, 128, 3],\n [39, 22, 91, 0, 128, 4],\n [39, 18, 131, 0, 128, 10],\n [39, 17, 71, 0, 133, 5],\n [39, 21, 86, 0, 133, 8],\n [37, 20, 75, 0, 134, 3],\n [39, 19, 90, 0, 134, 6],\n [39, 16, 123, 0, 128, 5],\n [39, 15, 124, 0, 128, 6],\n [40, 14, 151, 0, 128, 12],\n [41, 13, 128, 0, 128, 26],\n [32, 22, 76, 1, 128, 14],\n [26, 23, 97, 1, 128, 15],\n [29, 33, 121, 2, 128, 20],\n [28, 30, 106, 3, 128, 24],\n [21, 20, 122, 3, 128, 40],\n [21, 28, 127, 4, 128, 29],\n [21, 33, 129, 4, 128, 30],\n [20, 27, 105, 5, 128, 31],\n [20, 30, 111, 5, 128, 32],\n [27, 6, 84, 0, 128, 2],\n [33, 37, 108, 0, 129, 8],\n [41, 12, 89, 0, 133, 3],\n [39, 11, 94, 0, 133, 4],\n [36, 9, 98, 0, 133, 11],\n [34, 8, 82, 0, 134, 5],\n [32, 6, 126, 0, 128, 9],\n [35, 9, 101, 0, 133, 12],\n [30, 4, 91, 0, 134, 4],\n [28, 2, 84, 0, 134, 2],\n [25, 6, 88, 1, 128, 7],\n [29, 14, 91, 1, 129, 2],\n [33, 36, 99, 1, 129, 4],\n [24, 38, 110, 6, 128, 41],\n [23, 38, 105, 8, 128, 42],\n [20, 38, 97, 10, 128, 43],\n [21, 8, 126, 2, 128, 16],\n [0, 28, 119, 2, 128, 56],\n [12, 8, 122, 6, 128, 33],\n [21, 29, 113, 5, 246, 1],\n [25, 30, 97, 5, 128, 34],\n [38, 30, 99, 2, 128, 35],\n [21, 22, 121, 3, 128, 28],\n [12, 8, 118, 3, 128, 25],\n [20, 13, 112, 3, 128, 23],\n [29, 32, 108, 4, 129, 7],\n [27, 31, 123, 5, 129, 11],\n [15, 3, 138, 6, 129, 10],\n [21, 3, 126, 2, 129, 3],\n [20, 3, 119, 2, 129, 5],\n [21, 14, 144, 9, 128, 17],\n [15, 38, 133, 12, 128, 44],\n [0, 20, 135, 10, 128, 45],\n [0, 8, 137, 18, 128, 46],\n [0, 18, 141, 11, 128, 47],\n [0, 10, 128, 15, 128, 48],\n [0, 14, 157, 13, 133, 9],\n [0, 33, 124, 19, 133, 13],\n [0, 11, 159, 20, 133, 14],\n [0, 15, 129, 22, 133, 15],\n [0, 20, 135, 24, 133, 16],\n [0, 10, 123, 11, 134, 7],\n [0, 10, 167, 10, 128, 37],\n [0, 32, 149, 7, 128, 43],\n [0, 11, 139, 6, 128, 49],\n [0, 25, 138, 8, 128, 50],\n [0, 12, 153, 11, 128, 52],\n [0, 23, 165, 9, 128, 54],\n [0, 13, 124, 12, 128, 55],\n [0, 31, 178, 3, 240, 1],\n [0, 15, 150, 9, 240, 2],\n [0, 27, 141, 13, 240, 3],\n [0, 17, 206, 14, 240, 4],\n [0, 7, 130, 1, 128, 79],\n [0, 10, 112, 2, 133, 18],\n [0, 8, 139, 3, 133, 19],\n [0, 9, 113, 4, 128, 95],\n [0, 18, 152, 5, 133, 20],\n [0, 16, 131, 6, 128, 67],\n [0, 12, 127, 7, 128, 66],\n [0, 14, 166, 8, 133, 28],\n [0, 25, 219, 7, 128, 39],\n [0, 11, 202, 12, 128, 59],\n [0, 23, 185, 6, 128, 60],\n [0, 19, 233, 10, 128, 61],\n [0, 21, 244, 11, 246, 2],\n [0, 33, 223, 12, 133, 31],\n [0, 28, 237, 13, 245, 1],\n [0, 13, 245, 14, 240, 5],\n [0, 26, 242, 15, 133, 32],\n [0, 10, 239, 16, 240, 6],\n [0, 29, 251, 17, 133, 33],\n [0, 35, 246, 18, 133, 34],\n [0, 27, 235, 19, 128, 38],\n [0, 22, 247, 20, 128, 36],\n [0, 32, 241, 21, 133, 8],\n [0, 26, 236, 21, 133, 12],\n [0, 8, 223, 22, 240, 7],\n [0, 28, 202, 23, 240, 8],\n [0, 16, 222, 23, 133, 11],\n [0, 12, 224, 24, 240, 9],\n [0, 30, 235, 25, 240, 10],\n [0, 24, 225, 25, 133, 7],\n ],\n // cart defines lat, lon, mstr for '42, but corpt & corpno duplicate '41, and arrive is calculated\n [OobVariantKey.cart42]: [\n // [\"CORPSX42\", \"CORPSY42\", \"MSTRNG42\", \"ARRIVE42\", \"CORPT\", \"CORPNO\"]\n [0, 0, 0, 255, 0, 0],\n [20, 20, 150, 0, 4, 24],\n [35, 29, 131, 0, 4, 46],\n [26, 26, 108, 0, 4, 47],\n [20, 21, 146, 0, 4, 57],\n [32, 36, 90, 0, 0, 5],\n [32, 35, 116, 0, 0, 6],\n [32, 34, 120, 0, 0, 7],\n [32, 32, 96, 0, 0, 8],\n [33, 31, 82, 0, 0, 9],\n [20, 19, 142, 0, 4, 41],\n [19, 16, 169, 0, 4, 56],\n [33, 29, 87, 0, 0, 1],\n [32, 28, 91, 0, 0, 2],\n [30, 28, 101, 0, 0, 10],\n [28, 28, 104, 0, 0, 26],\n [26, 28, 112, 0, 0, 28],\n [24, 27, 120, 0, 0, 38],\n [17, 12, 182, 0, 4, 3],\n [14, 11, 130, 0, 4, 14],\n [14, 9, 142, 0, 4, 48],\n [24, 28, 140, 0, 0, 49],\n [24, 26, 124, 0, 0, 4],\n [24, 24, 119, 0, 0, 17],\n [23, 23, 111, 0, 0, 29],\n [19, 15, 97, 0, 48, 1],\n [19, 13, 96, 0, 48, 2],\n [18, 12, 92, 0, 48, 4],\n [14, 12, 125, 0, 0, 11],\n [14, 10, 131, 0, 0, 30],\n [14, 8, 106, 0, 0, 54],\n [35, 38, 112, 0, 32, 2], // finn1\n [36, 37, 104, 0, 32, 4], // finn2\n [19, 14, 201, 0, 4, 40],\n [20, 18, 98, 0, 84, 1],\n [22, 23, 110, 0, 0, 27],\n [21, 22, 95, 0, 0, 23],\n [16, 12, 52, 0, 48, 5],\n [20, 17, 97, 0, 0, 12],\n [20, 1, 106, 0, 0, 13],\n [19, 0, 101, 0, 0, 34],\n [18, 3, 96, 0, 0, 35],\n [17, 2, 55, 0, 64, 4],\n [27, 26, 102, 0, 3, 1],\n [22, 20, 138, 0, 3, 2],\n [16, 10, 142, 0, 3, 3],\n [20, 2, 124, 0, 3, 4],\n [20, 15, 115, 0, 3, 5],\n // Russian offset +48 hex #$30\n [20, 28, 242, 0, 129, 1],\n [21, 29, 128, 0, 133, 2],\n [32, 37, 104, 0, 128, 19],\n [31, 34, 92, 0, 128, 18],\n [31, 35, 84, 0, 134, 1],\n [31, 32, 138, 0, 128, 27],\n [31, 33, 114, 0, 133, 10],\n [31, 31, 147, 0, 128, 22],\n [32, 31, 132, 0, 128, 21],\n [32, 30, 136, 0, 128, 13],\n [28, 30, 141, 0, 133, 6],\n [33, 36, 236, 0, 129, 9],\n [32, 29, 141, 0, 128, 8],\n [31, 29, 137, 0, 128, 11],\n [30, 29, 125, 0, 133, 1],\n [29, 29, 135, 0, 133, 7],\n [28, 29, 130, 0, 128, 3],\n [27, 29, 122, 0, 128, 4],\n [26, 29, 105, 0, 128, 10],\n [25, 29, 101, 0, 133, 5],\n [24, 29, 126, 0, 133, 8],\n [23, 29, 115, 0, 134, 3],\n [23, 28, 119, 0, 134, 6],\n [23, 27, 123, 0, 128, 5],\n [23, 26, 124, 0, 128, 6],\n [23, 25, 118, 0, 128, 12],\n [23, 24, 128, 0, 128, 26],\n [22, 24, 136, 0, 128, 14],\n [21, 24, 137, 0, 128, 15],\n [21, 23, 121, 0, 128, 20],\n [20, 23, 126, 0, 128, 24],\n [20, 22, 122, 0, 128, 40],\n [19, 22, 113, 0, 128, 29],\n [19, 21, 112, 0, 128, 30],\n [19, 20, 121, 0, 128, 31],\n [19, 19, 111, 0, 128, 32],\n [19, 18, 104, 0, 128, 2],\n [33, 37, 108, 0, 129, 8],\n [19, 17, 115, 0, 133, 3],\n [18, 16, 112, 0, 133, 4],\n [18, 15, 108, 0, 133, 11],\n [14, 19, 112, 0, 134, 5],\n [13, 16, 126, 0, 128, 9],\n [17, 14, 136, 0, 133, 12],\n [16, 14, 108, 0, 134, 4],\n [15, 14, 119, 0, 134, 2],\n [14, 14, 117, 0, 128, 7],\n [31, 37, 121, 0, 129, 2],\n [31, 36, 110, 0, 129, 4],\n [13, 13, 110, 0, 128, 41],\n [13, 12, 105, 0, 128, 42],\n [13, 11, 127, 0, 128, 43],\n [13, 10, 126, 0, 128, 16],\n [13, 9, 119, 0, 128, 56],\n [13, 8, 122, 0, 128, 33],\n [13, 7, 113, 0, 246, 1],\n [30, 30, 123, 0, 128, 34],\n [19, 25, 124, 0, 128, 35],\n [17, 23, 121, 0, 128, 28],\n [14, 18, 118, 0, 128, 25],\n [15, 21, 112, 0, 128, 23],\n [20, 0, 70, 0, 129, 7], // 7 MILITA ARMY @ Sevastopol auto-recovers\n [12, 4, 160, 0, 129, 11],\n [12, 8, 138, 0, 129, 10],\n [6, 15, 230, 0, 129, 3],\n [16, 3, 192, 0, 129, 5],\n [0, 20, 144, 2, 128, 17],\n [0, 12, 133, 3, 128, 44],\n [0, 30, 135, 3, 128, 45],\n [0, 10, 137, 4, 128, 46],\n [0, 6, 141, 4, 128, 47],\n [0, 22, 128, 5, 128, 48],\n [0, 15, 157, 5, 133, 9],\n [0, 24, 124, 6, 133, 13],\n [0, 16, 159, 6, 133, 14],\n [0, 18, 129, 7, 133, 15],\n [0, 35, 135, 7, 133, 16],\n [0, 10, 123, 8, 134, 7],\n [0, 20, 167, 8, 128, 37],\n [0, 26, 149, 9, 128, 43],\n [0, 5, 139, 9, 128, 49],\n [0, 11, 138, 10, 128, 50],\n [0, 14, 153, 10, 128, 52],\n [0, 22, 165, 11, 128, 54],\n [0, 33, 124, 11, 128, 55],\n [0, 19, 178, 12, 240, 1],\n [0, 8, 150, 12, 240, 2],\n [0, 28, 141, 13, 240, 3],\n [0, 15, 206, 13, 240, 4],\n [0, 13, 150, 14, 128, 79],\n [0, 35, 132, 14, 133, 18],\n [0, 6, 149, 15, 133, 19],\n [0, 10, 161, 15, 128, 95],\n [0, 30, 152, 16, 133, 20],\n [0, 15, 141, 16, 128, 67],\n [0, 25, 137, 17, 128, 66],\n [0, 11, 176, 17, 133, 28],\n [0, 22, 219, 18, 128, 39],\n [0, 19, 192, 18, 128, 59],\n [0, 30, 195, 19, 128, 60],\n [0, 21, 233, 19, 128, 61],\n [0, 15, 244, 20, 246, 2],\n [0, 7, 223, 20, 133, 31],\n [0, 28, 227, 21, 245, 1],\n [0, 10, 245, 21, 240, 5],\n [0, 33, 242, 22, 133, 32],\n [0, 12, 229, 22, 240, 6],\n [0, 26, 251, 23, 133, 33],\n [0, 14, 246, 23, 133, 34],\n [0, 24, 235, 24, 128, 38],\n [0, 16, 237, 24, 128, 36],\n [0, 6, 221, 25, 133, 8],\n [0, 35, 236, 25, 133, 12],\n [0, 10, 203, 26, 240, 7],\n [0, 30, 202, 26, 240, 8],\n [0, 19, 222, 27, 133, 11],\n [0, 37, 204, 27, 240, 9],\n [0, 23, 215, 28, 240, 10],\n [0, 31, 245, 28, 133, 7],\n ],\n} as const;\n\nexport {oobVariants, OobVariantKey};\n","import {options} from '../config';\nimport {\n type Point, type Flag,\n players, PlayerKey,\n terraintypes, TerrainKey,\n directions, DirectionKey,\n WeatherKey,\n UnitKindKey,\n clamp,\n} from './defs';\n\nimport {scenarios} from './scenarios';\nimport {Grid, type GridPoint} from './grid';\nimport {Path, MapPoint} from './map';\nimport {Game} from './game';\n\ntype UnitType = {label: string, kind: UnitKindKey, immobile?: number};\nconst enum UnitTypeKey {\n infantry, militia, unused, flieger, panzer, tank, cavalry, pzgrndr\n}\nconst unittypes: Record<UnitTypeKey, UnitType | null> = {\n [UnitTypeKey.infantry]: {label: \"infantry\", kind: UnitKindKey.infantry},\n [UnitTypeKey.militia]: {label: \"militia\", kind: UnitKindKey.infantry, immobile: 1},\n [UnitTypeKey.unused]: null, // apx had unused labels for shock and paratrp\n [UnitTypeKey.flieger]: {label: \"flieger\", kind: UnitKindKey.air}, // cart only\n [UnitTypeKey.panzer]: {label: \"panzer\", kind: UnitKindKey.armor},\n [UnitTypeKey.tank]: {label: \"tank\", kind: UnitKindKey.armor},\n [UnitTypeKey.cavalry]: {label: \"cavalry\", kind: UnitKindKey.armor},\n [UnitTypeKey.pzgrndr]: {label: \"pzgrndr\", kind: UnitKindKey.armor}, // apx only\n};\n\nconst apxXref: Record<number, UnitTypeKey> = {\n 0: UnitTypeKey.infantry,\n 1: UnitTypeKey.tank,\n 2: UnitTypeKey.cavalry,\n 3: UnitTypeKey.panzer,\n 4: UnitTypeKey.militia,\n 5: UnitTypeKey.unused /* shock */,\n 6: UnitTypeKey.unused /* paratrp */,\n 7: UnitTypeKey.pzgrndr,\n },\n modifiers = [\n {key: ''},\n {key: 'ss'}, // unused\n {key: 'finnish', canAttack: 0},\n {key: 'rumanian'},\n {key: 'italian'},\n {key: 'hungarian'},\n {key: 'mountain'}, // unused\n {key: 'guards'},\n ];\n\n// output-only status flags persisted during turn processing and emitted as events\nconst unitFlag = {\n orders: 1 << 0,\n attack: 1 << 1,\n defend: 1 << 2,\n damage: 1 << 3,\n move: 1 << 4,\n enter: 1 << 5,\n exit: 1 << 6,\n oos: 1 << 7,\n} as const\ntype UnitEvent = keyof typeof unitFlag;\n\nconst enum UnitMode {standard, assault, march, entrench} // cartridge.asm's MVMODE\nconst unitModes = {\n [UnitMode.standard]: {label: 'STANDARD'},\n [UnitMode.assault]: {label: 'ASSAULT'},\n [UnitMode.march]: {label: 'MARCH'},\n [UnitMode.entrench]: {label: 'ENTRENCH'},\n} as const;\n\n// random bytes to use for deterministic fog of war matching\nconst fogTable = `\ne6 63 03 60 39 b0 1a 5f 1b 2f 95 2c 37 0d 1c 09 08 a5 35 22 4f c5 fe fe c5 49 75 95 34 22 f8 37\nc5 39 0c 51 48 53 d6 c2 c6 d8 1f 48 ac 2f f2 fb 91 06 34 86 a7 93 af f1 0a 3a 42 22 8b b4 e1 af\nb4 21 93 60 85 f1 62 5c 11 f8 2f 7a 79 79 f0 9d cd 05 40 ae 2b d1 e2 94 bc d0 d1 88 dc 22 7d 93\n61 bd cb 7f 64 79 a9 86 47 ee 6f a5 08 70 05 2f 01 2e b0 a5 8a 1e a5 00 c5 fa 0e 18 83 34 af 49\n6b 2a 25 aa 30 64 d6 4c 79 03 7b d7 25 fe 88 04 f5 0f a1 af b3 18 dd f0 10 ca 69 08 07 0e a2 73\n4b 27 4e ba 15 8a 5b d1 65 c1 3e 04 b2 13 2b f7 97 7e e7 e9 6f b8 5c 18 28 e5 65 d9 d7 65 26 4c\nc6 5e 1f 3a 88 0a f4 54 ac 9f 04 d6 ab 83 c5 bf 38 0a 93 e4 76 46 15 0b 24 fb b4 ba e6 55 4f 45\naa ad d7 cd aa 70 ef 5c 0d 9f 12 84 ca b9 36 fa 72 26 f9 ae 6d af af cf 57 4c cc 62 6f e5 e3 b1\n`.trim().split(/\\s+/).map(s => parseInt(s, 16));\n\nclass Unit {\n id: number;\n player: PlayerKey;\n unitno: number;\n kind: UnitKindKey;\n type: UnitTypeKey;\n modifier: number;\n immobile = 0;\n canAttack = 1;\n resolute = 0;\n label: string;\n arrive: number;\n scheduled: number;\n lon: number;\n lat: number;\n mstrng: number;\n cstrng: number;\n cadj = 0;\n fog: number;\n #mode: UnitMode;\n orders: DirectionKey[] = []; // WHORDRS, HMORDS\n tick = 255;\n ifr = 0;\n ifrdir: [number, number, number, number] = [0, 0, 0, 0];\n objective?: Point;\n flags = 0;\n\n #game: Game;\n\n constructor(game: Game, id: number, ...args: number[]) {\n let corpsx, corpsy, mstrng, arrive, corpt, corpno;\n\n switch (args.length) {\n case 7: { // apx\n let swap, corptapx;\n [corpsx, corpsy, mstrng, swap, arrive, corptapx, corpno] = args;\n // translate apx => cart format\n corpt = (swap & 0x80) | (corptapx & 0x70) | apxXref[corptapx & 0x7];\n break;\n }\n case 6: { // cart\n [corpsx, corpsy, mstrng, arrive, corpt, corpno] = args;\n break;\n }\n default:\n throw new Error(\"Expected 6 or 7 args for cartridge or apx unit definition respectively\");\n }\n this.id = id;\n this.player = (corpt & 0x80) ? PlayerKey.Russian : PlayerKey.German; // german=0, russian=1; equiv i >= 55\n this.unitno = corpno;\n this.type = corpt & 0x7 as UnitTypeKey;\n const ut = unittypes[this.type];\n if (ut == null) throw new Error(`Unused unit type for unit id ${id}`)\n this.kind = ut.kind;\n this.#mode = (this.kind == UnitKindKey.air) ? UnitMode.assault: UnitMode.standard;\n this.modifier = (corpt >> 4) & 0x7;\n this.arrive = arrive;\n this.scheduled = arrive;\n this.lon = corpsx;\n this.lat = corpsy;\n this.mstrng = mstrng;\n this.cstrng = mstrng;\n this.fog = scenarios[game.scenario].fog ?? 0;\n this.immobile = ut.immobile ?? 0;\n this.canAttack = modifiers[this.modifier].canAttack ?? 1;\n this.resolute = this.player == PlayerKey.German && !this.modifier ? 1: 0;\n this.label = [\n this.unitno,\n modifiers[this.modifier].key,\n ut.label,\n players[this.player].unit\n ].filter(Boolean).join(' ').toUpperCase().trim();\n\n this.#game = game;\n }\n get active() {\n return this.arrive <= this.#game.turn && this.cstrng > 0;\n }\n get movable() {\n if (this.immobile) return 0;\n // game logic seems to be that German reinforcements can move on arrival turn but Russians can't,\n // including initially placed units because of surprise attack.\n // allow initially placed Russians to move for post 6/22 scenarios\n const start = this.#game.turn == 0,\n green = this.arrive == this.#game.turn && !start;\n if (\n (green && PlayerKey.Russian)\n || (start && this.player == scenarios[this.#game.scenario].surprised)\n ) {\n return 0;\n }\n return 1;\n }\n get human() {\n return this.player == this.#game.human;\n }\n get location(): MapPoint {\n return this.#game.mapboard.locationOf(Grid.point(this));\n }\n get path(): MapPoint[] { // note returns non-empty list\n let loc = this.location;\n const path = [loc];\n this.orders.forEach(dir => {\n const dst = this.#game.mapboard.neighborOf(loc, dir);\n if (!dst) return;\n path.push(loc = dst)\n });\n return path;\n }\n emit(event: UnitEvent) {\n this.flags |= unitFlag[event];\n if (event == 'move') {\n // clear attack and defend status after movement\n this.flags &= ~(unitFlag.attack | unitFlag.defend);\n }\n this.#game.emit('unit', event, this);\n }\n get mode() { return this.#mode; }\n set mode(mode: UnitMode) {\n if (this.kind == UnitKindKey.air && ![UnitMode.assault, UnitMode.march].includes(mode)) {\n this.#game.emit('message', 'error', 'AIRPLANES CANNOT DO THAT');\n } else {\n this.#mode = mode;\n this.resetOrders();\n }\n }\n nextmode() {\n this.mode = this.kind == UnitKindKey.air\n ? (this.mode == UnitMode.assault ? UnitMode.march : UnitMode.assault)\n : (this.mode + 1) % 4;\n }\n foggyStrength(observer: PlayerKey) {\n let {mstrng, cstrng} = this;\n\n if (this.fog && this.player != observer) {\n // with fog of k bits, we apply noise with total range 2^k - 1,\n // between 2^(k-1), -2^(k-1)+1\n // we use the same offset for both cstrng and mstrng,\n // and predictable pseudo-random values that stay fixed given unit & turn\n // (and don't affect the core sequence of random values from the game's rng)\n const mask = (1 << this.fog) - 1,\n randbyte = fogTable[this.id & 0xff] ^ fogTable[(~this.#game.turn) & 0xff],\n delta = (randbyte & mask) - (mask >> 1);\n\n //TODO use as offset not a simple random fill\n mstrng = clamp(mstrng + delta, 1, 255);\n cstrng = clamp(cstrng + delta, 1, 255);\n }\n return {mstrng, cstrng};\n }\n addOrder(dir: number) {\n let dst: MapPoint|undefined,\n err: string|undefined;\n if (this.mode == UnitMode.entrench) {\n err = \"THAT UNIT IS ENTRENCHED\"\n } else if (!this.movable) {\n err = this.immobile ? \"MILITIA UNITS CAN'T MOVE\": \"NEW ARRIVALS CAN'T MOVE\";\n } else if (this.orders.length == 8) {\n err = \"ONLY 8 ORDERS ARE ALLOWED\";\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n dst = this.#game.mapboard.neighborOf(this.path.pop()!, dir);\n if (!dst) {\n err = \"IMPASSABLE\";\n } else {\n this.orders.push(dir);\n }\n }\n if (err) {\n this.#game.emit('message', 'error', err)\n } else {\n this.emit('orders');\n }\n return dst;\n }\n delOrder() {\n if (this.orders.length) {\n this.orders.pop();\n this.emit('orders');\n }\n }\n setOrders(dirs: DirectionKey[]) {\n this.orders = dirs;\n this.emit('orders');\n }\n resetOrders() {\n this.orders = [];\n this.tick = 255;\n this.emit('orders');\n }\n setOrdersSupportingFriendlyFurther(dir: DirectionKey) {\n const mb = this.#game.mapboard;\n let loc = Grid.point(this);\n this.orders.forEach(d => loc = Grid.adjacent(loc, d));\n const\n {dlon, dlat} = directions[dir],\n target = Grid.diamondSpiral(loc, 8, dir)\n .find(p => {\n if ((p.lon - loc.lon)*dlon + (p.lat - loc.lat)*dlat <= 0\n || Grid.manhattanDistance(p, this) > 8\n || !mb.valid(p)) {\n return false;\n } else {\n const mp = mb.locationOf(p);\n return (\n mp.unitid != null && mp.unitid != this.id\n && this.#game.oob.at(mp.unitid).player == this.player\n )\n }\n });\n\n if (target == null) {\n this.#game.emit('message', 'error', 'NO FRIENDLY UNIT IN RANGE THAT WAY')\n } else {\n this.setOrders(this.#game.mapboard.directPath(Grid.point(this), target).orders);\n }\n }\n moveCost(terrain: TerrainKey, weather: WeatherKey): number {\n // cost to enter given terrain in weather\n if (this.mode == UnitMode.entrench) {\n return 255;\n }\n const notInfantry = this.kind == UnitKindKey.infantry ? 0 : 1;\n let cost = terraintypes[terrain].movecost[notInfantry][weather] || 255;\n if (cost == 255) {\n return cost;\n }\n if (this.mode == UnitMode.march) cost = (cost >> 1) + 2;\n else if (this.mode == UnitMode.assault) cost += cost >> 1;\n return cost;\n }\n moveCosts(weather: WeatherKey): number[] {\n // return a table of movement costs based on armor/inf and weather\n return Object.keys(terraintypes).map(t => this.moveCost(+t, weather));\n }\n orderCost(dir: DirectionKey): number {\n if (!this.movable) return 255;\n const dst = this.#game.mapboard.neighborOf(Grid.point(this), dir);\n if (!dst) return 255;\n return this.moveCost(dst.terrain, this.#game.weather);\n }\n scheduleOrder(startTurn = false) {\n if (startTurn) {\n this.tick = 0;\n if (this.mode == UnitMode.march && this.orders.length && this.cstrng > 1) {\n // cstrng halved (min 1) before movement (cartridge.asm:4153)\n this.cstrng >>= 1;\n }\n if (this.kind == UnitKindKey.air && this.mode == UnitMode.assault && this.orders.length) {\n // add air strength to target cadj (cartridge.asm:4180)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const dst = this.path.pop()!;\n if (dst.unitid != null && dst.gid != this.location.gid) {\n const u = this.#game.oob.at(dst.unitid);\n if (u.player == this.player) {\n const halfDistance = Math.max(1, this.orders.length >> 1);\n u.cadj += Math.floor(this.cstrng / halfDistance);\n }\n }\n this.resetOrders(); // clear orders: air mission flown\n }\n }\n\n this.tick = this.orders.length\n ? this.tick + this.orderCost(this.orders[0])\n : 255;\n }\n pathTo(goal: Point): Path {\n const m = this.#game.mapboard,\n costs = this.moveCosts(this.#game.weather),\n p = Grid.point(goal);\n return options.astarPathFinding\n ? m.bestPath(Grid.point(this), p, costs)\n : m.directPath(Grid.point(this), p, costs)\n }\n reach(range = 32): GridPoint[] {\n // return a list of grid points within range of this unit\n if (this.mode == UnitMode.entrench) {\n return [Grid.point(this)];\n } else if (this.kind == UnitKindKey.air && this.mode == UnitMode.assault) {\n return Grid.diamondSpiral(this, range / 4)\n .filter(p => this.#game.mapboard.valid(p));\n } else {\n const costs = this.moveCosts(this.#game.weather);\n return Object.keys(this.#game.mapboard.reach(Grid.point(this), range, costs))\n .map(id => Grid.byid(+id));\n }\n }\n moveTo(dst: MapPoint|null, notify = true) {\n let action: UnitEvent = 'move';\n\n if (this.location.unitid) {\n if (this.location.unitid != this.id) {\n throw(`moveTo from square occupied by both:\\n${this.describe()}\\nand:\\n${this.#game.oob.at(this.location.unitid).describe()}`)\n }\n this.location.unitid = undefined; // leave the current location\n } else {\n action = 'enter';\n }\n if (dst != null) {\n if (dst.unitid != null)\n throw new Error(`moveTo into occupied square:\\n${this.#game.mapboard.describe(dst)}\\nby:\\n${this.describe()}\\nfrom lon: ${this.lon}, lat: ${this.lat}`);\n // occupy the new one and repaint\n this.lon = dst.lon;\n this.lat = dst.lat;\n dst.unitid = this.id;\n this.#game.mapboard.occupy(dst, this.player);\n } else {\n action = 'exit';\n }\n if (notify) this.emit(action);\n }\n tryOrder() {\n // if we decided to try before this unit retreated (say), skip\n if (this.tick == 255 || this.orders.length == 0) return;\n\n const src = this.location,\n dst = this.#game.mapboard.neighborOf(src, this.orders[0]); // assumes already validated\n\n if (dst == null) throw new Error(\"Unit.tryOrder: invalid order\");\n\n if (dst.unitid != null) {\n const opp = this.#game.oob.at(dst.unitid);\n if (opp.player != this.player) {\n if (!this.#resolveCombat(opp)) {\n this.tick++;\n return;\n }\n // otherwise fall through to advance after combat, ignoring ZoC\n } else {\n // traffic jam\n this.tick += 2;\n return;\n }\n } else if (this.#game.oob.zocBlocked(this.player, src, dst)) {\n // moving between enemy ZOC M.ASM:5740\n this.tick += 2;\n return;\n }\n\n this.orders.shift();\n this.moveTo(dst);\n this.scheduleOrder();\n }\n #resolveCombat(opp: Unit) {\n // returns 1 if target square becomes vacant\n if (!this.canAttack) return 0;\n\n // Air suffers 75% loss and resetOrders if attack or defend, plus normal combat (cartridge.asm:1968)\n [this, opp].forEach(u => {\n if (u.kind == UnitKindKey.air) {\n u.cstrng >>= 2;\n u.resetOrders();\n }\n })\n\n const scenario = scenarios[this.#game.scenario];\n\n this.emit('attack');\n opp.emit('defend');\n\n let modifier = terraintypes[opp.location.terrain].defence;\n // expert scenario defense bonus\n modifier += scenario.defmod ?? 0;\n if (opp.orders.length) modifier--; // movement penalty\n if (opp.mode == UnitMode.entrench) modifier++; // entrench bonus\n\n // opponent attacks\n let strength = multiplier(opp.cstrng, modifier) + opp.cadj;\n\n if (strength >= this.#game.rand.byte()) {\n // attacker in assault mode takes triple damage\n const mult = this.mode == UnitMode.assault ? 3: 1;\n this.#takeDamage(mult * scenario.mdmg, mult * scenario.cdmg, true);\n // cartridge prevents attack if attacker breaks\n if (!this.orders && options.defenderFirstStrike) return 0;\n }\n\n // modifier based on attacker's square (cartridge.asm:2035)\n modifier = terraintypes[this.location.terrain].offence;\n strength = multiplier(this.cstrng, modifier) + this.cadj;\n\n if (strength >= this.#game.rand.byte()) {\n // defender takes double damange\n const mult = this.mode == UnitMode.assault ? 2: 1;\n return opp.#takeDamage(mult * scenario.mdmg, mult * scenario.cdmg, true, this.orders[0]);\n } else {\n return 0;\n }\n }\n #takeDamage(mdmg: number, cdmg: number, checkBreak = false, retreatDir?: DirectionKey) {\n // return 1 if this square is vacated, 0 otherwise\n const scenario = scenarios[this.#game.scenario];\n\n // apply mdmg/cdmg to unit\n this.mstrng -= mdmg;\n this.cstrng -= cdmg;\n\n // dead?\n if (this.cstrng <= 0) {\n this.eliminate(options.disperseEliminatedUnits);\n this.moveTo(null);\n return 1;\n }\n this.emit('damage');\n\n if (!checkBreak) return 0;\n\n let brkpt; // calculate the strength value to check for unit breaking point\n if (scenario.simplebreak) {\n // simplified break check at 25% strength\n brkpt = this.mstrng >> 2;\n } else {\n if (this.resolute) {\n // german regulars break if cstrng < 1/2 mstrng\n brkpt = this.mstrng >> 1;\n } else {\n // russian (& ger allies) break if cstrng < 7/8 mstrng\n brkpt = this.mstrng - (this.mstrng >> 3);\n }\n brkpt = this.mstrng - (this.mstrng >> (this.resolute ? 1: 3));\n switch (this.mode) {\n case UnitMode.march:\n brkpt <<= 1;\n break;\n case UnitMode.assault:\n case UnitMode.entrench:\n brkpt >>= 1;\n break;\n case UnitMode.standard:\n break;\n }\n }\n\n if (this.cstrng < brkpt) {\n this.mode = this.kind == UnitKindKey.air ? UnitMode.march : UnitMode.standard;\n this.resetOrders();\n\n if (retreatDir != null) {\n const homedir = players[this.player].homedir,\n nxtdir = this.#game.rand.bit() ? DirectionKey.north : DirectionKey.south,\n dirs = [retreatDir, homedir, nxtdir, (nxtdir + 2) % 4, (homedir + 2) % 4];\n\n for (const dir of dirs) {\n const src = this.location,\n dst = this.#game.mapboard.neighborOf(src, dir);\n if (!dst || dst.unitid != null || this.#game.oob.zocBlocked(this.player, src, dst)) {\n // ZoC block deals only CSTR dmg (cartridge:2159)\n if (this.#takeDamage(0, scenario.cdmg)) return 1; // dead\n } else {\n this.moveTo(dst);\n return 1;\n }\n }\n }\n }\n // otherwise square still occupied (no break or all retreats blocked but defender remains)\n return 0;\n }\n recover() {\n // units recover a little each tick\n if (this.type == UnitTypeKey.militia && this.lon == 20 && this.lat == 0) {\n // Sevastopol militia fully recovers each turn\n this.cstrng = this.mstrng;\n } else if (this.mstrng - this.cstrng >= 2) {\n // M.ASM:5070 recover one plus coin-flip combat strength\n this.cstrng += 1 + this.#game.rand.bit();\n }\n }\n eliminate(disperse?: boolean) {\n if (disperse) {\n // eliminated units disperse nearby (cartridge.asm:2509)\n this.#game.mapboard\n .neighborsOf(this.location)\n .forEach(loc => {\n if (loc?.unitid == null) return;\n const u = this.#game.oob.at(loc.unitid);\n if (u.player == this.player) {\n u.mstrng = Math.min(255, u.mstrng + (this.mstrng >> 2));\n }\n })\n }\n this.mstrng = 0;\n this.cstrng = 0;\n this.arrive = 255;\n this.flags = 0;\n this.resetOrders();\n }\n nextTurn(startOrResume: boolean) {\n // called for active (or potentially active) units\n const scenario = scenarios[this.#game.scenario];\n\n if (startOrResume) {\n // place units on map but don't emit events\n this.moveTo(this.location, false);\n\n if (this.#game.turn == 0 && scenario.fog) {\n this.fog = scenario.fog;\n if (options.reduceInitialFogInContact) {\n // a unit completely surrounded sees zoc = 12, unit with seven units on a corner sees 7\n this.fog >>= this.#game.oob.zocAffecting(this.player, this.location, true) / 2;\n }\n }\n } else {\n // M.ASM:3720 delay reinforcements scheduled for an occuplied square\n if (this.arrive == this.#game.turn) {\n if (this.location.unitid != null) {\n this.arrive++;\n return; // early return\n }\n this.moveTo(this.location); // place unit on the map\n }\n // supply check includes any new arrivals\n const inSupply = scenario.skipsupply || this.traceSupply();\n if (scenario.repl && inSupply) {\n // possibly receive replacements\n this.mstrng = Math.min(255, this.mstrng + scenario.repl[this.player]);\n }\n if (!this.active) return; // quit if eliminated OoS\n\n if (scenario.fog) {\n const change = this.#game.oob.zocAffects(this.player, this.location, true) ? -1 : 1;\n this.fog = clamp(this.fog + change, 0, scenario.fog)\n }\n }\n\n this.flags = 0;\n this.cadj = this.player == PlayerKey.German ? (scenarios[this.#game.scenario].cadj ?? 0) : 0\n }\n traceSupply(): Flag {\n // implement the supply check from C.ASM:3430\n // loses half cstr (rounding up) if OoS, returning 1 if supplied, 0 if not\n const player = players[this.player],\n supply = player.supply,\n mb = this.#game.mapboard;\n let fail = 0,\n loc = this.location,\n dir = player.homedir;\n\n if (supply.freeze && this.#game.weather == WeatherKey.snow) {\n // C.ASM:3620\n if (this.#game.rand.byte() >= 74 + 4*(mb.boundaryDistance(loc, dir) + (dir == DirectionKey.east ? 1 : 0))) {\n fail = 255;\n }\n }\n while(fail < supply.maxfail[this.#game.weather]) {\n if (dir == player.homedir && mb.boundaryDistance(loc, player.homedir) == 0) {\n // hit an impassable boundary on our home boundary?\n return 1;\n }\n\n let dst = mb.neighborOf(loc, dir);\n if (dst == null && supply.sea) {\n const adj = Grid.adjacent(loc, dir);\n if (mb.valid(adj)) {\n const sea = mb.locationOf(adj);\n if (sea.terrain == TerrainKey.impassable && sea.alt == 0) dst = sea;\n }\n }\n let cost = 0;\n\n if (dst == null) {\n cost = 1;\n } else if (this.#game.oob.zocAffects(this.player, dst)) {\n cost = 2;\n } else {\n loc = dst;\n }\n if (cost) {\n fail += cost;\n // either flip a coin or try the opposite direction (potentially repeatedly until failure)\n if (dir != player.homedir) dir = (dir + 2) % 4;\n else dir = this.#game.rand.bit() ? DirectionKey.north : DirectionKey.south;\n } else {\n dir = player.homedir;\n }\n }\n this.#takeDamage(0, Math.ceil(this.cstrng/2));\n this.emit('oos');\n return 0;\n }\n locScore() {\n const dist = this.#game.mapboard.boundaryDistance(this, players[this.player].homedir);\n let v = 0;\n // see M.ASM:4050 - note even inactive units are scored based on future arrival/strength\n if (this.player == PlayerKey.German) {\n // maxlon + 2 == #$30 per M.ASM:4110\n v = (dist + 3) * (this.mstrng >> 1);\n } else {\n v = dist * (this.cstrng >> 3);\n }\n return v >> 8;\n }\n describe(debug = false) {\n const {cstrng, mstrng} = this.foggyStrength(this.#game.human);\n let s = `[${this.id}] ${cstrng} / ${mstrng}`;\n if (debug && scenarios[this.#game.scenario].fog && this.player != this.#game.human) {\n s += ` (actual ${this.cstrng} / ${this.mstrng}; fog ${this.fog})`;\n }\n s += `\\n${this.label}\\n`;\n\n if (debug && this.ifr !== undefined && this.ifrdir !== undefined) {\n if (this.orders.length) {\n s += 'orders: ' + this.orders.map(d => directions[d].label).join('') + '\\n';\n }\n s += `ifr: ${this.ifr}; `;\n s += Object.entries(directions)\n .map(([i, d]) => `${d.label}: ${this.ifrdir[+i as DirectionKey]}`).join(' ') + '\\n';\n }\n return s;\n }\n}\n\nfunction multiplier(strength: number, modifier: number): number {\n if (modifier > 0) {\n strength <<= modifier;\n } else {\n strength >>= (-modifier);\n }\n return clamp(strength, 1, 255);\n}\n\nexport {Unit, type UnitEvent, unitFlag, UnitMode, unitModes};\n","import {zigzag, zagzig} from './codec';\nimport {scenarios} from './scenarios';\nimport {Unit} from './unit';\nimport {oobVariants} from './oob-data';\nimport {sum, PlayerKey, players, type Point} from './defs';\nimport {Game} from './game';\nimport {Grid} from './grid';\nimport {type MapPoint} from './map';\n\ntype UnitPredicate = (u: Unit, index: number) => boolean;\ntype UnitMap<T> = (u: Unit, index: number) => T;\ntype UnitForeach = (u: Unit, index: number) => void;\n\nclass Oob {\n #game;\n #units;\n startmstrng: [number, number] = [0, 0]; // sum all mstrng for scoring\n\n constructor(game: Game, memento?: number[]) {\n const scenario = scenarios[game.scenario],\n maxunit = scenario.nunit;\n this.#units = oobVariants[scenario.oob]\n .map((vs, i) => {\n const u = new Unit(game, i, ...vs);\n // exclude units not in the scenario, but leave them in array\n if (u.id >= maxunit[u.player]) u.eliminate();\n this.startmstrng[u.player] += u.mstrng;\n return u;\n });\n this.#game = game;\n\n if (memento) {\n const scheduled: Unit[] = this.filter(u => u.scheduled <= game.turn);\n if (memento.length < scheduled.length)\n throw new Error('Oob: malformed save data for scheduled unit status');\n scheduled.forEach(u => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const status: number = memento.shift()!;\n if (status == 1) { // eliminated\n u.eliminate()\n } else if (status == 2) { // delayed\n u.arrive = game.turn + 1;\n }\n });\n const active = this.activeUnits(),\n human = active.filter(u => u.human),\n expected = (scenario.fog ? 5 : 4) * active.length + human.length * (scenario.mvmode ? 2 : 1);\n\n if (memento.length < expected)\n throw new Error('oob: malformed save data for active unit properties');\n\n const dlats = zagzig(memento.splice(0, active.length)),\n dlons = zagzig(memento.splice(0, active.length)),\n dmstrs = zagzig(memento.splice(0, active.length)),\n cdmgs = memento.splice(0, active.length),\n dfogs = scenario.fog ? memento.splice(0, active.length): [],\n modes = scenario.mvmode ? memento.splice(0, human.length): [],\n nords = memento.splice(0, human.length);\n let lat = 0, lon = 0, mstr = 255;\n active.forEach(u => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n lat += dlats.shift()!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n lon += dlons.shift()!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n mstr += dmstrs.shift()!;\n [u.lat, u.lon, u.mstrng] = [lat, lon, mstr];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n u.cstrng = u.mstrng - cdmgs.shift()!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (scenario.fog) u.fog -= dfogs.shift()!;\n });\n if (memento.length < sum(nords))\n throw new Error('oob: malformed save data for unit orders');\n human.forEach(u => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (scenario.mvmode) u.mode = modes.shift()!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n u.orders = memento.splice(0, nords.shift()!);\n });\n }\n }\n at(index: number): Unit {\n const u = this.#units.at(index);\n if (!u) throw new Error(`Oob.at(${index}): Invalid unit index`);\n return u;\n }\n every(f: UnitPredicate) { return this.#units.every(f) }\n some(f: UnitPredicate) { return this.#units.some(f) }\n filter(f: UnitPredicate) { return this.#units.filter(f) }\n find(f: UnitPredicate) { return this.#units.find(f) }\n findIndex(f: UnitPredicate) { return this.#units.findIndex(f) }\n forEach(f: UnitForeach) { this.#units.forEach(f); }\n map<T>(f: UnitMap<T>) { return this.#units.map(f); }\n slice(start?: number, end?: number) { return this.#units.slice(start, end)}\n\n get memento() {\n const scenario = scenarios[this.#game.scenario],\n dlats: number[] = [],\n dlons: number[] = [],\n dmstrs: number[] = [],\n cdmgs: number[] = [],\n modes: number[] = [],\n dfogs: number[] = [],\n nords: number[] = [],\n ords: number[] = [];\n let lat = 0, lon = 0, mstr = 255;\n\n // for scheduled units, status = 0 (active), 1 (dead), 2 (delayed)\n const scheduled = this.filter(u => u.scheduled <= this.#game.turn),\n status = scheduled.map(u => u.active ? 0: (u.cstrng == 0 ? 1: 2)),\n active = scheduled.filter(u => u.active);\n\n active.forEach(u => {\n dlats.push(u.lat - lat);\n dlons.push(u.lon - lon);\n dmstrs.push(u.mstrng - mstr);\n [lat, lon, mstr] = [u.lat, u.lon, u.mstrng];\n if (scenario.fog) dfogs.push(scenario.fog - u.fog);\n\n cdmgs.push(u.mstrng - u.cstrng);\n if (u.human) {\n nords.push(u.orders.length);\n ords.push(...u.orders);\n if (scenario.mvmode) modes.push(u.mode);\n }\n });\n\n return (status as number[]).concat(zigzag(dlats), zigzag(dlons), zigzag(dmstrs), cdmgs, dfogs, modes, nords, ords);\n }\n scoreStrengths(player: PlayerKey): number {\n const\n scenario = this.#game.scenario,\n scoring = scenarios[scenario].scoring,\n current = Object.keys(players).map(\n p => sum(this.#units.filter(u => (u.player == +p)).map(u => u.cstrng)) >> 7\n ),\n losses = Object.keys(players).map(\n p => (this.startmstrng[+p] >> 7) - current[+p]\n );\n\n let score = 0;\n (scoring.strength ?? []).forEach((mode, p) => {\n if (mode) score += ((p == player) ? 1: -1) * (mode == 'current' ? current[p] : -losses[p]);\n })\n return (player == PlayerKey.German ? 1: -1) * score;\n }\n nextTurn(startOrResume: boolean) {\n this.activeUnits().forEach(u => u.nextTurn(startOrResume));\n }\n activeUnits(player?: PlayerKey): Unit[] {\n return this.filter((u: Unit) => u.active && (player == null || u.player == player));\n }\n centerOfGravity(player?: PlayerKey): Point {\n const units = this.activeUnits(player),\n {lat, lon} = units.reduce(\n ({lat, lon}, u) => ({lat: lat + u.lat, lon: lon + u.lon}),\n {lat: 0, lon: 0}\n );\n // note this usually returns fractional lat/lon which is ok for scroll management\n return {lat: lat/units.length, lon: lon/units.length};\n }\n scheduleOrders() {\n // M.asm:4950 movement execution\n this.activeUnits().forEach(u => u.scheduleOrder(true));\n }\n executeOrders(tick: number) {\n // original code processes movement in reverse-oob order\n //TODO config to randomize order, or allow a delay/no-op order type to manage traffic?\n this.activeUnits().forEach(u => u.recover())\n this.activeUnits()\n .filter(u => u.tick == tick)\n .reverse()\n .forEach(u => u.tryOrder());\n }\n zocAffects(player: PlayerKey, loc: MapPoint, omitSelf = false): boolean {\n return this.zocAffecting(player, loc, omitSelf, 2) >= 2;\n }\n zocAffecting(player: PlayerKey, loc: MapPoint, omitSelf = false, threshold?: number) {\n // evaluate zoc experienced by player (eg. exerted by !player) in the square at loc\n let zoc = 0;\n // same player in target square negates any zoc, enemy exerts 4\n if (loc.unitid != null) {\n if (this.at(loc.unitid).player == player) {\n if (!omitSelf) return 0;\n } else {\n zoc += 4;\n if (threshold && zoc >= threshold) return zoc;\n }\n }\n if (scenarios[this.#game.scenario].nozoc) return zoc;\n\n // look at square spiral excluding center, so even squares are adj, odd are corners\n Grid.squareSpiral(loc, 1).slice(1).forEach((p, i) => {\n if (!this.#game.mapboard.valid(p)) return;\n const pt = this.#game.mapboard.locationOf(p);\n // center-adjacent (even) exert 2, corners (odd) exert 1\n if (pt.unitid != null && this.at(pt.unitid).player != player) {\n zoc += (i % 2) ? 1: 2;\n if (threshold && zoc >= threshold) return zoc;\n }\n });\n return zoc;\n }\n zocBlocked(player: PlayerKey, src: MapPoint, dst: MapPoint): boolean {\n // does enemy ZoC block player move from src to dst?\n return this.zocAffects(player, src, true) && this.zocAffects(player, dst);\n }\n}\n\nexport {Oob};\n","import {sum, players, type Point, PlayerKey, directions, DirectionKey, terraintypes, TerrainKey} from './defs';\nimport {Grid, type GridPoint} from './grid';\nimport {MapPoint} from './map';\nimport {type Oob} from './oob';\nimport {Unit} from './unit';\n\nimport {type Game} from './game';\nclass Thinker {\n #game: Game;\n #player: PlayerKey;\n #trainOfThought = 0;\n #depth = 0;\n #delay = 0;\n finalized = true;\n\n constructor(game: Game, player: PlayerKey) {\n this.#game = game;\n this.#player = player;\n }\n\n thinkRecurring(delay?: number) {\n this.#delay = (delay == null) ? 250: delay;\n this.finalized = false;\n\n this.#recur(this.#trainOfThought);\n }\n\n #recur(train: number) {\n if (train != this.#trainOfThought) {\n // skip pre-scheduled old train of thought\n console.debug(`Skipped passing thought, train ${train}`);\n return;\n }\n const t0 = performance.now();\n this.think();\n const dt = performance.now() - t0;\n\n this.#delay *= 1.1; // gradually back off thinking rate\n console.debug(`Think.#recur ${train}-${this.#depth} took ${Math.round(dt)}ms; waiting ${Math.round(this.#delay)}ms`);\n this.#depth++;\n\n setTimeout(() => this.#recur(train), this.#delay);\n }\n finalize() {\n console.debug(\"Finalizing...\")\n this.#trainOfThought++;\n this.#depth = 0;\n this.finalized = true;\n this.#game.oob.activeUnits(this.#player).forEach(u => u.setOrders(u.orders.slice(0, 8)));\n }\n think() {\n const\n firstpass = this.#depth == 0,\n pinfo = players[this.#player],\n friends = this.#game.oob.activeUnits(this.#player),\n foes = this.#game.oob.activeUnits(1-this.#player);\n\n // set up the ghost army\n let ofr = 0; // only used in first pass\n if (firstpass) {\n ofr = calcForceRatios(this.#game.oob, this.#player).ofr;\n friends.forEach(u => {u.objective = {lon: u.lon, lat: u.lat}});\n }\n\n friends.filter(u => u.movable).forEach(u => {\n //TODO these first two checks don't seem to depend on ghost army so are fixed on first pass?\n if (firstpass && u.ifr == (ofr >> 1)) {\n // head to reinforce if no local threat since (Local + OFR) / 2 = OFR / 2\n //TODO this tends to send most units to same beleagured square\n const v = this.#findBeleaguered(u, friends);\n if (v) u.objective = {lon: v.lon, lat: v.lat};\n } else if (firstpass && (u.cstrng <= (u.mstrng >> 1) || u.ifrdir[pinfo.homedir] >= 16)) {\n // run home if hurting or outnumbered in the rear\n // for Russian the whole eastern edge is valid, but generalize to support German AI or variant maps\n const bbox = this.#game.mapboard.bbox,\n lon = bbox[pinfo.homedir],\n south = bbox[DirectionKey.south],\n north = bbox[DirectionKey.north],\n lat = [...Array(north-south+1).keys()]\n .map(k => k+south)\n .sort((a, b) => (Math.abs(a-u.lat) - Math.abs(b-u.lat)) || a-b)\n .find(lat => this.#game.mapboard.locationOf(Grid.lonlat(lon, lat)).terrain != TerrainKey.impassable)\n ?? u.lat;\n u.objective = {lon, lat};\n } else {\n // find nearest best square\n const start = this.#game.mapboard.locationOf(Grid.point(u.objective as Point));\n let bestval = this.#evalLocation(u, start, friends, foes);\n this.#game.mapboard.neighborsOf(start).forEach(loc => {\n if (!loc) return;\n const sqval = this.#evalLocation(u, loc, friends, foes);\n if (sqval > bestval) {\n bestval = sqval;\n u.objective = {lon: loc.lon, lat: loc.lat};\n }\n });\n }\n if (!u.objective) return;\n const result = u.pathTo(u.objective);\n if (!result) return;\n u.setOrders(result.orders); // We'll prune to 8 later\n });\n\n return friends.filter(u => u.objective);\n }\n #findBeleaguered(u: Unit, friends: Unit[]): Unit | null {\n let best: Unit | null = null, score = 0;\n friends.filter(v => v.ifr > u.ifr).forEach(v => {\n const d = Grid.manhattanDistance(u, v);\n if (d <= 8) return; // APX code does weird bit 3 check\n const s = v.ifr - (d >> 3);\n if (s > score) {\n score = s;\n best = v;\n }\n });\n return best;\n }\n #evalLocation(u: Unit, loc: MapPoint, friends: Unit[], foes: Unit[]) {\n const ghosts: Record<number, number> = {},\n range = Grid.manhattanDistance(u, loc);\n\n // too far, early exit\n if (range >= 8) return 0;\n\n const nbval = Math.min(...foes.map(v => Grid.manhattanDistance(loc, v)));\n\n // on the defensive and square is occupied by an enemy\n if (u.ifr >= 16 && nbval == 0) return 0;\n\n friends.filter(v => v.id != u.id)\n .forEach(v => { ghosts[Grid.point(v.objective as Point).gid] = v.id; });\n\n const isOccupied = (pt: GridPoint) => !!ghosts[pt.gid];\n let dibs = false;\n\n if (isOccupied(loc)) dibs = true; // someone else have dibs already?\n else ghosts[loc.gid] = u.id;\n\n const square = Grid.squareSpiral(loc, 2),\n linepts = Object.keys(directions).map(\n d => linePoints(sortSquareFacing(loc, 5, +d, square), 5, isOccupied)\n ),\n tadj = terraintypes[loc.terrain].defence + 2; // our 0 adj is equiv to his 2\n\n let sqval = sum(linepts.map((scr, i) => scr * u.ifrdir[i])) >> 8;\n sqval += u.ifr >= 16 ? u.ifr * (nbval + tadj) : 2 * (15 - u.ifr) * (9 - nbval + tadj);\n if (dibs) sqval -= 32;\n sqval -= 1 << range;\n return sqval < 0 ? 0 : sqval;\n }\n}\n\nfunction calcForceRatios(oob: Oob, player: PlayerKey) {\n const active = oob.activeUnits(),\n friend = sum(active.filter(u => u.player == player).map(u => u.cstrng)),\n foe = sum(active.filter(u => u.player != player).map(u => u.cstrng)),\n ofr = Math.floor((foe << 4) / friend),\n ofropp = Math.floor((friend << 4) / foe);\n\n active.forEach(u => {\n const nearby = active.filter(v => Grid.manhattanDistance(u, v) <= 8),\n p = Grid.point(u);\n let friend = 0;\n u.ifrdir = [0, 0, 0, 0];\n nearby.forEach(v => {\n const inc = v.cstrng >> 4;\n if (v.player == u.player) friend += inc;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n else u.ifrdir[Grid.directionFrom(p, Grid.point(v))!] += inc; // enemy can't be in same square\n })\n // individual and overall ifr max 255\n const ifr = Math.floor((sum(u.ifrdir) << 4) / friend);\n // we actually work with average of IFR + OFR\n u.ifr = (ifr + (u.player == player ? ofr: ofropp)) >> 1;\n });\n return {ofr, friend, foe};\n}\n\nfunction sortSquareFacing(center: Point, diameter: number, dir: DirectionKey, locs: Point[]) {\n if (diameter % 2 != 1) throw(`sortSquareFacing: diameter should be odd, got ${diameter}`);\n if (!locs || locs.length != diameter * diameter) throw(`sortSquareFacing: diameter : size mismatch ${locs.length} != ${diameter}^2`);\n\n const r = (diameter - 1)/2,\n minor = directions[(dir+1)%4 as DirectionKey],\n major = directions[(dir+2)%4 as DirectionKey],\n out = new Array(locs.length);\n\n locs.forEach(loc => {\n const dlat = loc.lat - center.lat,\n dlon = loc.lon - center.lon,\n idx = (\n r + dlat * major.dlat + dlon * major.dlon\n + diameter * (r + dlat * minor.dlat + dlon * minor.dlon)\n );\n out[idx] = loc;\n })\n return out;\n}\n\nfunction linePoints(locs: GridPoint[], diameter: number, occupied: (pt: GridPoint) => boolean) {\n // curious that this doesn't consider terrain, e.g. a line ending at the coast will get penalized heavily?\n const r = (diameter-1)/2,\n frontline = Array(diameter).fill(diameter),\n counts = Array(diameter).fill(0);\n let row = -1, col = -1,\n score = 0;\n\n locs.forEach(loc => {\n row = (row + 1) % diameter;\n if (row == 0) col++;\n if (occupied(loc)) {\n counts[col] += 1;\n if (frontline[col] == diameter) frontline[col] = row;\n }\n })\n frontline.forEach((row, col) => {\n if (row < diameter) score += 40;\n if (row < diameter-1 && occupied(locs[row + 1 + diameter*col])) score -= 32;\n })\n if (frontline[r] == r && counts[r] == 1) score += 48;\n // also curious that we look at all pairs not just adjacent ones?\n for (let i=1; i<diameter; i++) for (let j=0; j<i; j++) {\n const delta = Math.abs(frontline[i]-frontline[j]);\n if (delta) score -= 1 << delta;\n }\n return score;\n}\n\nconst privateExports = {calcForceRatios, linePoints, sortSquareFacing};\n\nexport {Thinker, privateExports};\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport {wrap64, unwrap64, fibencode, fibdecode, rlencode, rldecode, bitsencode, bitsdecode} from './codec';\nimport {sum, PlayerKey, monthdata, MonthKey, WeatherKey} from './defs';\nimport {scenarios, ScenarioKey} from './scenarios';\nimport {Mapboard, type MapEvent, type MapPoint} from './map';\nimport {Oob} from './oob';\nimport type {Unit, UnitEvent} from './unit';\nimport {lfsr24, type Generator} from './rng';\n\nimport {EventEmitter} from 'events';\n\nconst\n tokenPrefix = 'EF41',\n tokenVersion = 1,\n rlSigil = 6; // highest 5-bit coded value, so values 0..3 (& 4,5) are unchanged by rlencode\n\ntype GameEvent = 'turn' | 'tick' | 'over';\ntype MessageLevel = 'error'; // currently only error is defined\n\nclass Game extends EventEmitter {\n scenario = ScenarioKey.learner;\n human = PlayerKey.German;\n\n turn = 0; // 0-based turn index\n\n // helpers derived from turn via #setDates\n date!: Date;\n month!: MonthKey;\n weather!: WeatherKey;\n\n // flags\n handicap = 0; // whether the game is handicapped\n\n mapboard: Mapboard;\n oob: Oob;\n rand: Generator;\n\n // create a game from a saved state token, a scenario key, or default\n constructor(token: string)\n constructor(scenario: ScenarioKey, seed?: number)\n constructor(tokenOrScenario: string | ScenarioKey, seed?: number) {\n super(); // init EventEmitter\n let memento: number[] | undefined;\n\n if (typeof tokenOrScenario === 'number') {\n this.scenario = tokenOrScenario;\n } else if (typeof tokenOrScenario === 'string') {\n const payload = unwrap64(tokenOrScenario, tokenPrefix);\n\n seed = bitsdecode(payload, 24);\n memento = rldecode(fibdecode(payload), rlSigil);\n\n if (memento.length < 7) throw new Error('Game: malformed save data');\n const version = memento.shift()!;\n if (version != tokenVersion) throw new Error(`Game: unrecognized save version ${version}`);\n\n this.scenario = memento.shift()!;\n this.human = memento.shift()!;\n this.turn = memento.shift()!;\n\n this.handicap = memento.shift()!;\n }\n // create the oob and maboard, using memento if there was one\n this.mapboard = new Mapboard(this, memento);\n this.oob = new Oob(this, memento);\n this.rand = lfsr24(seed);\n\n if (memento && memento.length != 0) {\n throw new Error(\"Game: unexpected save data overflow\");\n }\n\n this.nextTurn(true);\n }\n get memento() {\n // return a list of uint representing the state of the game\n return [\n tokenVersion,\n\n this.scenario,\n this.human,\n this.turn,\n\n +this.handicap,\n ].concat(\n this.mapboard.memento,\n this.oob.memento,\n );\n }\n get token() {\n const payload = ([] as number[]).concat(\n bitsencode(this.rand.state(), 24),\n fibencode(rlencode(this.memento, rlSigil))\n );\n return wrap64(payload, tokenPrefix);\n }\n get over() {\n const scenario = scenarios[this.scenario];\n\n return (\n this.turn >= scenario.endturn\n || this.score(PlayerKey.German) >= scenario.scoring.win\n // special end condition for learner mode\n || (this.scenario == ScenarioKey.learner && this.mapboard.cities[0].owner == PlayerKey.German)\n );\n }\n resolveTurn(delay?: number) {\n // external entry for nextTurn to process orders for this turn\n // and advance to next\n // if delay is provided we tick asynchrnously,\n // otherwise we resolve synchronously\n let tick = 0;\n\n this.oob.scheduleOrders();\n\n // Set up for a sync or async loop\n const tickTock = () => {\n this.oob.executeOrders(tick);\n this.emit('game', 'tick');\n const next = tick++ < 32 ? tickTock : () => this.nextTurn();\n if (!delay) next(); else setTimeout(next, delay);\n }\n tickTock();\n }\n nextTurn(startOrResume = false) {\n const dt = new Date(scenarios[this.scenario].start),\n ongoing = !this.over;\n\n if (!startOrResume && ongoing) this.turn++;\n\n this.date = new Date(dt.setDate(dt.getDate() + 7 * this.turn));\n this.month = this.date.getMonth() as MonthKey; // note JS getMonth is 0-indexed\n this.weather = monthdata[this.month].weather;\n\n if (startOrResume || ongoing) {\n this.mapboard.nextTurn(startOrResume);\n this.oob.nextTurn(startOrResume);\n }\n\n this.emit('game', ongoing ? 'turn': 'over');\n }\n score(player: PlayerKey): number {\n // M.asm:4050\n const scoring = scenarios[this.scenario].scoring;\n const eastwest = sum(this.oob.map(u => u.locScore() * (u.player == player ? 1: -1))),\n strng = this.oob.scoreStrengths(player),\n cities = sum(this.mapboard.cities.filter(c => c.owner == player).map(c => c.points));\n let score = cities + (scoring.location ? Math.max(0, eastwest) : 0) + strng + (scoring.adjust ?? 0);\n if (this.handicap) score >>= 1;\n return score;\n }\n // declare legal event signatures\n emit(event: 'game', action: GameEvent): boolean;\n emit(event: 'map', action: MapEvent, loc: MapPoint): boolean;\n emit(event: 'unit', action: UnitEvent, u: Unit): boolean;\n emit(event: 'message', level: MessageLevel, message: string): boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n emit(event: string, ...args: any[]): boolean {\n return super.emit(event, ...args)\n }\n on(event: 'game', listener: (action: GameEvent) => void): this;\n on(event: 'map', listener: (action: MapEvent, loc: MapPoint) => void): this;\n on(event: 'unit', listener: (action: UnitEvent, u: Unit) => void): this;\n on(event: 'message', listener: (level: MessageLevel, message: string) => void): this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (...args: any[]) => void): this {\n return super.on(event, listener)\n }\n}\n\nexport {Game};\n"],"names":[],"mappings":";;;AAKA,SAAS,GAAG,CAAC,EAAY,EAAA;AACrB,IAAA,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAS,EAAE,CAAS,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,KAAK,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW,EAAA;AAC9C,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,OAAO,CAAO,EAAe,EAAA;AAClC,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC9B,MAAM,MAAM,GAAG,UAAU,CAAI,EAAA;AACzB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;;AAEvC,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC;AACzB,KAAC,CAAC;AACF,IAAA,OAAO,MAAM,CAAC;AAClB,CAAC;AAMD,MAAM,UAAU,GAAoC;AAChD,IAAA,CAAA,CAAA,4BAAsB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAG,IAAI,EAAE,CAAC,EAAG,IAAI,EAAE,IAAI,EAAC;AAClE,IAAA,CAAA,CAAA,2BAAsB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE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