import { Vec2 } from '@lib/model' ; export const drawMapStatic = < T > ( map , renderTile , startY , endY , startX , endX , flip = false , numbered = false ) : string [ ] [ ] => { const res = [ ] ; if ( numbered ) { res . push ( [ ... Array ( endX - startX + 1 ) . keys ( ) ] . map ( ( i ) => i + startX ) . map ( ( i ) => ( i >= 10 ? i . toString ( ) : '0' + i . toString ( ) ) ) ) ; } for ( let i = startY ; i <= endY ; i ++ ) { const row = numbered ? [ i >= 10 ? i . toString ( ) : '0' + i . toString ( ) ] : [ ] ; for ( let j = startX ; j <= endX ; j ++ ) { row . push ( renderTile ( map . get ( new Vec2 ( flip ? i : j , flip ? j : i ) . toString ( ) ) ) ) ; } res . push ( row ) ; } return res ; } ;