Parse map text: one row per line, comma-separated codes. A token may be <side> <code> to mark that side's keep/start, which is how a leader knows where to appear.
<side> <code>
import { parseTerrain } from '@datamoc/mw_games/mwl';const map = parseTerrain('Gg,Gg\nGg,1 Kh');console.log(map.width, map.starts['1']); // 2 [{ x: 1, y: 1 }] Copy
import { parseTerrain } from '@datamoc/mw_games/mwl';const map = parseTerrain('Gg,Gg\nGg,1 Kh');console.log(map.width, map.starts['1']); // 2 [{ x: 1, y: 1 }]
Parse map text: one row per line, comma-separated codes. A token may be
<side> <code>to mark that side's keep/start, which is how a leader knows where to appear.