import {Grid} from "./engine/datatypes.ts"; export type ConceptualCell = "X" | "." | " "; function loadMap(map: Array): Grid { let src = Grid.createGridFromStringArray(map); return src.map((char: string): ConceptualCell => { switch(char) { case "X": return "X"; case ".": return "."; case " ": return " "; default: throw `map element not valid: ${char}` }}); } export let maps: Record> = { map0: loadMap([ "XX XX", "X. .X", " ", " ", " ", " ", " ", "X. .X", "XX XX", ]), map1: loadMap([ "XX. XX", "XXX X .X", ".XX XX ", " .XX ", " ", " XX. ", " XX XX.", "X. X XXX", "XX .XX", ]), map2: loadMap([ "XX XXXX XX", "X. XXXXXX .X", " XX..XX ", " ", " ", " ", " XX..XX ", "X. XXXXXX .X", "XX XXXX XX", ]), map3: loadMap([ "X XXXX X", " . . ", " . . ", "X XXXX X", "X XXXX X", "X XXXX X", " . . ", " . . ", "X XXXX X", ]), }